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

add dotnet new sln --format slnx #44469

Merged
merged 4 commits into from
Oct 30, 2024
Merged

add dotnet new sln --format slnx #44469

merged 4 commits into from
Oct 30, 2024

Conversation

kasperk81
Copy link
Contributor

dotnet new sln --help
Solution File
Author: Microsoft
Description: Create an empty solution containing no projects

Usage:
  dotnet new sln [options] [template options]
  dotnet new solution [options] [template options]

Options:
  -n, --name <name>      The name for the output being created. If no name is specified, the name of the output directory is used.
  -o, --output <output>  Location to place the generated output.
  --dry-run              Displays a summary of what would happen if the given command line were run if it would result in a template creation.
  --force                Forces content to be generated even if it would change existing files.
  --no-update-check      Disables checking for the template package updates when instantiating a template.
  --project <project>    The project that should be used for context evaluation.

Template options:
  -f, --format <sln|slnx>  Choose the format for the solution file: traditional (.sln) or XML-based (.slnx).
                           Type: choice
                             sln   Traditional solution file
                             slnx  XML-based solution file
                           Default: sln

default (without --format) is .sln.

Contributes to #40913

@kasperk81 kasperk81 requested a review from a team as a code owner October 27, 2024 00:32
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Oct 27, 2024
@kasperk81 kasperk81 changed the title add dotnet new sln --slnx add dotnet new sln --format slnx Oct 27, 2024
@kasperk81 kasperk81 closed this Oct 27, 2024
@kasperk81 kasperk81 reopened this Oct 27, 2024
@kasperk81
Copy link
Contributor Author

@baronfel ptal. i don't know why the ci is not starting here. i tried closing reopening and pushing changes but no luck

@baronfel
Copy link
Member

@kasperk81 my best guess is that resources are slammed right now preparing for .NET 9 GA? I'll kick them and see if that helps.

@baronfel
Copy link
Member

/azp run dotnet-sdk-public-ci,sdk-source-build, sdk-unified-build

Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content here seems fine - though without dotnet sln add and dotnet sln remove users won't be able to really do anything useful with the slnx yet. That's fine, I just wanted to call it out for now.

Thank you for taking an interest in this @kasperk81!

@kasperk81
Copy link
Contributor Author

Thanks @baronfel! This PR (dotnet new sln -f slnx, adding a new argument to an existing command) and the related PR #44419 (dotnet sln migrate, introducing a new command) are two of the three PRs required to complete this feature. The upcoming PR will focus on adding slnx support to dotnet sln {add, remove, list} and may also replace SlnFile.cs with vs-solutionpersistence to handle both traditional and XML formats for loading, modifying, and saving the solution model, given that vs-solutionpersistence supports both with unified API. Once all three PRs are merged, we can backport them to the 9.0.200 branch.

@baronfel
Copy link
Member

/azp run

@kasperk81
Copy link
Contributor Author

saw same issue in #44481. it seems to be randomly filtering out some PRs and running for others

@just-ero
Copy link

Will slnx become the default at some point?

@baronfel
Copy link
Member

Yes, but that will require coordination with the VS solution team around when they want to make the format 'stable' and default to it in VS. Having that decision require just a very small boolean default value change in the template here is a smart move by @kasperk81 to make the cost of updating the SDK to match VS very light.

@kasperk81
Copy link
Contributor Author

@surayya-MS, @rainersigwald, do you and your team have any suggestions (drawing on your experience with MSBuild) for implementing the dotnet sln {add, remove, list} commands? I’m thinking of structuring this work in two PRs:

  • First PR: Remove src/Cli/Microsoft.DotNet.Cli.Sln.Internal and replace it with vs-solutionpersistence, adjusting all relevant extensions and usage. This part could be tricky because AddFolder and certain solution configurations don’t map 1:1, so I’d love to know if you encountered similar challenges during the MSBuild port and how you approached them.
  • Second PR: Introduce .slnx support for these commands.

Would you or someone from your team be interested in helping with the initial replacement or providing input? Any insights from the MSBuild transition would be especially helpful. Thank you! 😊

@baronfel
Copy link
Member

saw same issue in #44481. it seems to be randomly filtering out some PRs and running for others

There's an infrastructure issue in AzDo that's being worked on right now. Will bump this as I know more.

@baronfel
Copy link
Member

This LGTM, but I'm waiting for feedback from the VS Solution team about what they would like to call the two options for sln/slnx formats.

@baronfel
Copy link
Member

Ok I have feedback from the VS team on their desired terminology for the sln/slnx choice help text.

@kasperk81 please use the phrases "Solution file" and "XML Solution file" instead of "Traditional solution file" and "XML-based solution file". Other than that change this is good to go!

@baronfel
Copy link
Member

Thanks for this @kasperk81!

@baronfel baronfel merged commit 7125714 into dotnet:main Oct 30, 2024
37 checks passed
@baronfel
Copy link
Member

/backport to release/9.0.2xx

Copy link
Contributor

Started backporting to release/9.0.2xx: https://github.com/dotnet/sdk/actions/runs/11602176374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants