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

Introduce a way to create a solution file #7479

Closed
blackdwarf opened this issue Jan 10, 2017 · 12 comments
Closed

Introduce a way to create a solution file #7479

blackdwarf opened this issue Jan 10, 2017 · 12 comments

Comments

@blackdwarf
Copy link

No description provided.

@natemcmaster
Copy link
Contributor

dotnet new -t sln?

@blackdwarf
Copy link
Author

dotnet sln create. It should behave as such:

  1. Drop the SLN file named like the folder being dropped in.
  2. Glob all of the proj-es in the directories beneath it.
  3. If they exist, add them.
  4. If not, exit.

Thoughts?

@dasMulli
Copy link
Contributor

dasMulli commented Jan 13, 2017

I'd probably not add all projects by default.
dotnet sln add **/*.*proj should be the way to go.
Maybe even dotnet sln create New.sln **/*.*proj? (Making it figure out that if you don't pass a .sln as first arg, the next ones are already projects to add)

@DustinCampbell
Copy link
Member

I'm definitely all for this. I like @blackdwarf's suggestion and @dasMulli's refinement quite a bit.

blackdwarf referenced this issue in blackdwarf/cli Jan 21, 2017
This PR adds a create subcommand within the dotnet sln command. It will
drop a predefined SLN file to disk. The commands accepts one parameter
and that is the name of the file w/ an extension. This is a pretty basic
implementation for this first turn of the crank.

Fixed #5259
@blackdwarf
Copy link
Author

blackdwarf commented Jan 21, 2017

So we currently don't really support globbing as a parameter in any other CLI command. I would not like to introduce it here simply because I think it would require some more thought as to how it applies to other commands etc.

So the question remains, should then the first turn of the crank of dotnet sln create simply put down a valid SLN file and then later be enhanced or should we add the ability to get all of the projects in the dirs underneath the one where the command is invoked?

I would vote for option #4283 due to the time pressure.

@dasMulli
Copy link
Contributor

@blackdwarf in my example, the globs are evaluated by the user's shell. I think it already works with dotnet sln add.

@blackdwarf
Copy link
Author

@dasMulli interestingly enough, I can repro this on bash but cannot do it on PowerShell no matter what kind of glob I put in. Could it be specific to bash?

blackdwarf referenced this issue in blackdwarf/cli Jan 27, 2017
This PR adds a create subcommand within the dotnet sln command. It will
drop a predefined SLN file to disk. The commands accepts one parameter
and that is the name of the file w/ an extension. This is a pretty basic
implementation for this first turn of the crank.

Fixed #5259
@TheRealPiotrP
Copy link
Contributor

For 1.0.0 this will be handled via a template that will come in as part of dotnet new3. @mlorbetske is that new template in place yet?

@mlorbetske
Copy link
Contributor

The template is in place in the version that will get picked up by the new3 cutover

@TheSamsterZA
Copy link

@blackdwarf I think the default behaviour should be just to create the solution file ("first turn of the crank"), with the option to then add project files via a switch. So:

dotnet sln create <solution-filename>

would drop a valid sln in the containing folder with the given name (or, default to the folder name). It should be able to handle <solution-filename> with and without the .sln extension.

dotnet sln create <solution-filename> --add-projects

would do the above and also discover and add all project files below the containing folder.

Globbing functionality can be added later, but personally I think the above would cater for 90% of all cases.

@TheRealPiotrP
Copy link
Contributor

Fixed by dotnet/cli#5430

@cwharris
Copy link

cwharris commented Apr 4, 2017

For anyone wondering, you can create a solution file using dotnet new sln [-n <name>].

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants