-
Notifications
You must be signed in to change notification settings - Fork 541
[net10.0] [dotnet] Use the 'ComputeRunArguments' target to compute properties for 'dotnet run'. #22816
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
…or 'dotnet run'. In .NET 10 there's a new target we can hook into ("ComputeRunArguments") to do anything we need to do before 'dotnet run' runs the target app. For mobile (iOS and tvOS), we now run the "_PrepareRunMobile" target before "ComputeRunArguments", and this will: * Install the app on device for device builds. * Run mlaunch to run launch the app on device or in the simulator. For desktop (macOS and Mac Catalyst), we run the new "_PrepareRunDesktop" target before "ComputeRunArguments" to set the `RunCommand` and `RunArguments` properties. I've also added the capability to _not_ launch apps on desktop with `open`, by setting the property `RunWithOpen=false`. Also add support for passing arguments to the app when running on iOS and tvOS (by passing '-- <extra args' to mlaunch). Fixes #12459. Fixes #14845. References: * dotnet/sdk#42155 * dotnet/android#9470
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
$ dotnet run -p:OpenNewInstance=false | ||
``` | ||
|
||
### RunEnvironment |
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.
What about SetRunEnviromentVars
or SetRunEnviromentArgs
or SetEnviromentVars
or SetEnviromentArgs
? RunEnviroment
seems easy to clash just like the case we had with NativeLibrary
just my 2 cents, naming is hard heh
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 removed this option completely, it's possible to do the same thing with the OpenArguments
property, so document that instead.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #783ffc0] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #783ffc0] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #783ffc0] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #783ffc0] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #783ffc0] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #783ffc0] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #783ffc0] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #783ffc0] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 124 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
In .NET 10 there's a new target we can hook into ("ComputeRunArguments") to do anything
we need to do before 'dotnet run' runs the target app.
For mobile (iOS and tvOS), we now run the "_PrepareRunMobile" target before "ComputeRunArguments",
and this will:
For desktop (macOS and Mac Catalyst), we run the new "_PrepareRunDesktop" target
before "ComputeRunArguments" to set the
RunCommand
andRunArguments
properties.I've also added the capability to not launch apps on desktop with
open
, by settingthe property
RunWithOpen=false
.Also add support for passing arguments to the app when running on iOS and tvOS (by
passing '-- <extra args' to mlaunch).
Fixes #12459.
Fixes #14845.
References:
dotnet run
command discovery protocol to be settable by a Target instead of just Evaluation sdk#42155dotnet run
with an MSBuild target android#9470