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

@blackdwarf blackdwarf commented Jan 10, 2017

No description provided.

@natemcmaster

This comment has been minimized.

Copy link
Contributor

@natemcmaster natemcmaster commented Jan 12, 2017

dotnet new -t sln?

@blackdwarf

This comment has been minimized.

Copy link
Author

@blackdwarf blackdwarf commented Jan 13, 2017

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

This comment has been minimized.

Copy link
Contributor

@dasMulli 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

This comment has been minimized.

Copy link
Member

@DustinCampbell DustinCampbell commented Jan 19, 2017

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

This comment has been minimized.

Copy link
Author

@blackdwarf 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

This comment has been minimized.

Copy link
Contributor

@dasMulli dasMulli commented Jan 21, 2017

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

@blackdwarf

This comment has been minimized.

Copy link
Author

@blackdwarf blackdwarf commented Jan 21, 2017

@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

This comment has been minimized.

Copy link
Contributor

@TheRealPiotrP TheRealPiotrP commented Jan 31, 2017

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

This comment has been minimized.

Copy link
Contributor

@mlorbetske mlorbetske commented Jan 31, 2017

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

@TheSamsterZA

This comment has been minimized.

Copy link

@TheSamsterZA TheSamsterZA commented Jan 31, 2017

@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

This comment has been minimized.

Copy link
Contributor

@TheRealPiotrP TheRealPiotrP commented Feb 1, 2017

Fixed by dotnet/cli#5430

@cwharris

This comment has been minimized.

Copy link

@cwharris 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants
You can’t perform that action at this time.