fsprojects-archive / zzarchive-generator-fsharp

[ARCHIVED] Yeoman F# generator
Apache License 2.0
62 stars 27 forks source link

Add to solution doesn't add? #18

Closed devshorts closed 8 years ago

devshorts commented 8 years ago

Playing with the generator and am doing:

akropp at LMDV-AKROP in ~/src/personal/fs/SlnTest
$ yo fsharp

  ____    ____    __
 /\  _`\ /\  _`\ /\ \
 \ \ \L\_\ \,\L\_\ \ \___      __     _ __   _____
  \ \  _\/\/_\__ \\ \  _ `\  /'__`\  /\`'__\/\ '__`\
   \ \ \/   /\ \L\ \ \ \ \ \/\ \L\.\_\ \ \/ \ \ \L\ \
    \ \_\   \ `\____\ \_\ \_\ \__/.\_\\ \_\  \ \ ,__/
     \/_/    \/_____/\/_/\/_/\/__/\/_/ \/_/   \ \ \/
                                               \ \_\
                                                \/_/
Welcome to the perfect FSharp generator!
? What do You want to do? Create empty solution
? What's the name of your application? SLnTest
? Do You want to use Paket? Yes
ApplicationName.sln
   create SLnTest/SLnTest.sln
   create SLnTest/.paket/paket.bootstrapper.exe
No version specified. Downloading latest stable.

Starting download from https://github.com/fsprojects/Paket/releases/download/2.2.1/paket.exe

Done.

/Users/akropp/src/personal/fs/SlnTest/SLnTest
Paket version 2.2.1.0

Dependencies files saved to /Users/akropp/src/personal/fs/SlnTest/SLnTest/paket.dependencies

Solution /Users/akropp/src/personal/fs/SlnTest/SLnTest/SLnTest.sln changed

Resolving packages for group Main:

Locked version resolution written to /Users/akropp/src/personal/fs/SlnTest/SLnTest/paket.lock

1 second - ready.

Your project is now created

akropp at LMDV-AKROP in ~/src/personal/fs/SlnTest
$ ls
total 0
drwxr-xr-x  7 akropp  386085923  238 Sep 19 12:52 SLnTest

akropp at LMDV-AKROP in ~/src/personal/fs/SlnTest
$ cd SLnTest

akropp at LMDV-AKROP in ~/src/personal/fs/SlnTest/SLnTest
$ ls
total 24
-rw-r--r--  1 akropp  386085923  499 Sep 19 12:52 SLnTest.sln
drwxr-xr-x  2 akropp  386085923   68 Sep 19 12:52 packages
-rw-r--r--  1 akropp  386085923   32 Sep 19 12:52 paket.dependencies
-rw-r--r--  1 akropp  386085923    1 Sep 19 12:52 paket.lock

akropp at LMDV-AKROP in ~/src/personal/fs/SlnTest/SLnTest
$ cat SLnTest.sln

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{4D602BF5-F872-4AD0-B147-956973522466}"
    ProjectSection(SolutionItems) = preProject
        paket.dependencies = paket.dependencies
    EndProjectSection
EndProject
Global
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

And now to add to the solution

$ yo fsharp

  ____    ____    __
 /\  _`\ /\  _`\ /\ \
 \ \ \L\_\ \,\L\_\ \ \___      __     _ __   _____
  \ \  _\/\/_\__ \\ \  _ `\  /'__`\  /\`'__\/\ '__`\
   \ \ \/   /\ \L\ \ \ \ \ \/\ \L\.\_\ \ \/ \ \ \L\ \
    \ \_\   \ `\____\ \_\ \_\ \__/.\_\\ \_\  \ \ ,__/
     \/_/    \/_____/\/_/\/_/\/__/\/_/ \/_/   \ \ \/
                                               \ \_\
                                                \/_/
Welcome to the perfect FSharp generator!
? What do You want to do? Add new project to solution
? What type of application do you want to create? Console Application
? What's the name of your application? ConsoleTest
? Do You want to use Paket? Yes
App.config
ApplicationName.fs
ApplicationName.fsproj
   create ConsoleTest/App.config
   create ConsoleTest/ConsoleTest.fs
   create ConsoleTest/ConsoleTest.fsproj
identical .paket/paket.bootstrapper.exe
No version specified. Downloading latest stable.

Paket.exe 2.2.1.0 is up to date.

/Users/akropp/src/personal/fs/SlnTest/SLnTest
Paket version 2.2.1.0

Dependencies files saved to /Users/akropp/src/personal/fs/SlnTest/SLnTest/paket.dependencies

Resolving packages for group Main:

/Users/akropp/src/personal/fs/SlnTest/SLnTest/paket.lock is already up-to-date

0 seconds - ready.

Your project is now created

akropp at LMDV-AKROP in ~/src/personal/fs/SlnTest/SLnTest
$ cat SLnTest.sln

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{4D602BF5-F872-4AD0-B147-956973522466}"
    ProjectSection(SolutionItems) = preProject
        paket.dependencies = paket.dependencies
    EndProjectSection
EndProject
Global
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

But the SLN file doesn't change. Am I doing something wrong?

Krzysztof-Cieslak commented 8 years ago

.sln file is not getting changed. "Adding to solution" (yeah, that's maybe not best naming as it suggest editing .sln) is more about good (different than in standalone project case) handling of packages folder / .paket folder / paket.dependencies / etc.

devshorts commented 8 years ago

I see. Ok, thanks. Do you have any suggestions for managing the solution file?

Krzysztof-Cieslak commented 8 years ago

If You are using VS / XS and generator just for templating You can just use "add existing project" for solution.

If You are playing with text editors (Vim, Emacs, Sublime, or Ionide project) You don't need .sln file at all - this file is required only for VS / XS.