Skip to content
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

Rewrite dotnet watch command line parsing #39618

Merged
merged 3 commits into from
Apr 2, 2024
Merged

Rewrite dotnet watch command line parsing #39618

merged 3 commits into from
Apr 2, 2024

Conversation

tmat
Copy link
Member

@tmat tmat commented Mar 19, 2024

Instead of launching process directly in Hot Reload with Hot Reload environment variables set on the process start info, we now launch dotnet run (or any other dotnet command) with Hot Reload variables set via environment directives (i.e. dotnet [env:XYZ=...] run <remaining args>). This allows us to avoid interpreting the subcommand and most of the command line options and arguments passed to dotnet watch. We can now easily support any existing dotnet subcommand.

We have 3 kinds of options:

  1. dotnet-watch specific (such as --verbose)
    These are consumed by dotnet-watch and not included in <remaining args>

  2. options that dotnet-watch needs to understand but are passed through to the subcommand (e.g. --launch-profile)
    We parse these and include them in <remaining args> (if they precede the subcommand they are moved after the subcommand).

  3. other options
    These are not interpreted, just included in <remaining args>.

Fixes #39020
Fixes dotnet/aspnetcore#52294
Fixes #36611
Fixes #34055
Fixes #29539
Fixes #25612

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Watch untriaged Request triage from a team member labels Mar 19, 2024
@tmat tmat marked this pull request as ready for review March 27, 2024 03:12
@tmat tmat requested review from arunchndr and a team as code owners March 27, 2024 03:12
@tmat
Copy link
Member Author

tmat commented Mar 27, 2024

@WardenGnaw PTAL

@tmat tmat merged commit 810807e into dotnet:main Apr 2, 2024
16 checks passed
@tmat tmat deleted the WatchCli branch April 2, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Watch untriaged Request triage from a team member
Projects
None yet
3 participants