sdk
sdk copied to clipboard
[`dotnet-new`] Add inRoot option for AddProjectsToSolutionPostAction
For dotnet-new issue #4178.
Adds inRoot
argument which is passed to dotnet sln add
as --in-root
.
cc @vlada-shubina
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.
This change requires:
- documentation update: https://github.com/dotnet/templating/wiki/Post-Action-Registry
- JSON schema update: https://github.com/dotnet/templating/blob/main/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/Schemas/JSON/template.json
- port to 7.0.2xx when branch is available
@vlada-shubina I'm not sure about the unit test, I don't see one for --solution-folder
? Sorry, a bit new to this. Do we just need to test if DotnetSlnPostActionProcessor.TryGetProjectFilesToAdd
returns true
if --in-root
is passed in?
@vlada-shubina Also, was going to add another LocalizableString
for the --in-root
option output. How are these translated? https://github.com/dotnet/sdk/blob/3eea35e0d77f9a1bc418a364805ff89df818e371/src/Cli/dotnet/commands/dotnet-new/LocalizableStrings.resx#L161-L166
@vlada-shubina I'm not sure about the unit test, I don't see one for
--solution-folder
? Sorry, a bit new to this. Do we just need to test ifDotnetSlnPostActionProcessor.TryGetProjectFilesToAdd
returnstrue
if--in-root
is passed in?
Testing TryGetProjectFilesToAdd
doesn't make a lot of sense.
I would do a test similar to https://github.com/dotnet/sdk/blob/39f66f56bd9d66ccfdb904482d283b5506fc5a68/src/Tests/dotnet.Tests/dotnet-new/DotnetSlnPostActionTests.cs#L197-L223 and check if --inRoot
from args was passed properly to the mock callback.
@vlada-shubina Also, was going to add another
LocalizableString
for the--in-root
option output. How are these translated?https://github.com/dotnet/sdk/blob/3eea35e0d77f9a1bc418a364805ff89df818e371/src/Cli/dotnet/commands/dotnet-new/LocalizableStrings.resx#L161-L166
Just change an English string in LocalizableStrings.resx
as needed and build. The translation will come automatically after some time. If you are using placeholder or some text should not be translated, consider explaining them in Comments
column.
@vlada-shubina PR got messed up, will submit another one.