-
Notifications
You must be signed in to change notification settings - Fork 79
Codespaces: Fix launching all-sample app, add auto sample discovery #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| "name": "All samples app", | ||
| "type": "coreclr", | ||
| "request": "launch", | ||
| "program": "dotnet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we want to add this command as a separate job on the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't include in this PR because it isn't as easy as running a command in the CI.
To do this proper, we'd want to
- Investigate if we can validate the JSON as a VSCode config using some command line tool (make sure invalid json isn't generated or committed)
- Write a script to copy the command and parameters programmatically by reading the JSON file, then execute it to make sure it does fail.
- Repeat step 1 and 2 with the generated "discovered" sample launch configs.
b5a6c40 to
add326b
Compare
|
Rebased on top of main to grab the changes from #85 |
| Set-Content -Path $generatedSampleRefsPropsPath -Value $sampleRefsPropsTemplate; | ||
| Write-Output "Sample project references generated at $generatedSampleRefsPropsPath"; | ||
| # Run sample discovery | ||
| & ./DiscoverSamples.ps1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if the script is executed from a different directory? (Don't think that'll be a common occurrence, but curious as I know I had to use a different method in the past to grab the current directory of where the script was located that is being executed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this would work if ran from a different directory, same way relatives paths break in UseUnoWinUI.ps1 and UseTargetFrameworks.ps1 when run from the wrong directory.
|
When running the all solution - Looks like the docs are adding more to the path in Codespaces (this worked in VS Code locally last I checked for WASM): The files themselves are in the expected location (same as they are locally). So it looks like it may be the source generator output itself. (Tested a single experiment and that's working properly for the CS/XAML files to display the individual samples, but still fails on the doc with the same incorrect path.) Added the generated output from the SG to investigate (@mrlacey I had to add the I suspect this is Windows vs. Linux slashes, will try that quick with the string array for the split and see what happens. |
Did a quick test in a Codespace on @michael-hawker Is this a prerequisite for merging this, could we do this in another PR? Since this PR is only related to launching in a codespace and sample discovery for the VSCode dropdown, we should be good to go? |
|
@Arlodotexe it's a one-line fix, so I'll add it. I did see this trying to run Discover Samples directly: (If I ran the all samples instead first then it ran the generate solution and then discover samples fine...) After installing the powershell extension I got this: |
…ommunityToolkit/Labs-Windows into fix/codespace-sample-launching
That's so strange, I did this entire PR in a codespace. I'll test again with a fresh container and see if I can repro. |
michael-hawker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some known and unknown hiccups with how Codespaces works, but everything here looking good now, thanks!
…space-sample-launching Codespaces: Fix launching all-sample app, add auto sample discovery
…1/gallery-improvements Gallery improvements




This PR
Demos:
All-Samples-In-Codespaces-1.mp4
Sample-Discovery-Codespaces-1.mp4