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 Initialization Script #22

Closed
pblasucci opened this issue Dec 9, 2013 · 7 comments
Closed

Add Initialization Script #22

pblasucci opened this issue Dec 9, 2013 · 7 comments

Comments

@pblasucci
Copy link
Collaborator

Per request from Don Syme, it'd be nice to add an initialization script that does the necessary renamings in one go. Specifically, such a script would have to rename the following (based on user-supplied values):

  • Fsharp.ProjectScaffold.sln
  • src/Fsharp.ProjectTemplate
  • src/Fsharp.ProjectTemplate/Fsharp.ProjectTemplate.fsproj
  • tests/Fsharp.ProjectTemplate.Tests
  • tests/Fsharp.ProjectTemplate.Tests/Fsharp.ProjectTemplate.Tests.fsproj

Additionally, the following files would need their content updated (to reflect the changes listed above):

  • Fsharp.ProjectScaffold.sln (reference to Fsharp.ProjectTemplate.fsproj and Fsharp.ProjectTemplate.Tests.fsproj)
  • Fsharp.ProjectTemplate.fsproj (emitted assembly name)
  • Fsharp.ProjectTemplate.Tests.fsproj (emitted assembly name and reference to Fsharp.ProjectTemplate.fsproj)
  • docs/content/Index.fsx (reference to emitted assembly and project name)
  • docs/content/Tutorial.fsx (reference to emitted assembly and project name)
  • docs/tools/Generate.fsx (emitted assembly name, solution name, github repo name)
  • Build.fsx (solution name, project name, test project emitted assembly name, github repo name)

Also, while the script is changing files, it should probably replace README.md (in the root folder) with something simpler. And it might be nice to set the content of RELEASE_NOTES.md to something generic.

@pblasucci
Copy link
Collaborator Author

I have begun working on this. However, I'd like an opinion on which mechanism is best-suited for doing the work. So far, I've considered two options:

  1. As an independent root-level script (eg: init.cmd,init.sh)
  2. As a FAKE target (eg: Build InitLib ...)

Of course, if there are other ideas, I'm ready to discuss them.

@jackfoxy
Copy link
Collaborator

I just began thinking over this problem. I can see 2 scenarios:

  1. starting up a new project from scratch
  2. converting an existing project to scaffolding

I did a "back of the envelope" analysis of the 2nd scenario and came up with this outline I'm throwing out here for comment. All of the steps you have outlined for scenario 1 probably apply as well.

  1. clone scaffolding to temp folder
  2. delete .Git files & .git folder in cloned folder
  3. copy contents and subfolder of temp cloned folder to existing project folder
  4. git add scaffolding docs and libs folders & files
  5. git mv existing source folder to scaffolding src
  6. git mv existing test project folder to scaffolding tests
  7. git mv existing .nuget/* to scaffolding .nuget/
  8. delete old .nuget/
  9. move old packages/ folder to scaffolding packages/
  10. change all occurrences of project and test names in scaffolding files
  11. delete old bin
  12. change proj build target to scaffolding bin/
    --> at this point attempt build and doc generation
    --> make any corrections to the script
    --> git reset --hard (to revert all changes and try again...rinse and repeat)

@sergey-tihon
Copy link
Member

Ideas are really interesting and useful. Initialization script looks realistic, but convertion script looks fantastic a bit.
Questions that I have:

  1. What to do with possible multiple branches in repo?
  2. How we will apply changes to project files? We need to support different versions of VS... There are some conflicts possible...
  3. What to do with file/folder name conflicts (if such ones already exists)

@ovatsus
Copy link

ovatsus commented Apr 25, 2014

@sergey-tihon
Copy link
Member

As I know PR is coming... // cc: @gentauro

@ghost
Copy link

ghost commented Apr 26, 2014

Done :-)

#54

@fsgit
Copy link
Contributor

fsgit commented Jul 17, 2014

Closing, thank you @caindy

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

5 participants