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

Added support for renaming of the FSharp.ProjectScaffold and updated the README.MD file #54

Closed
wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2014

Hi maintainers of FSharp.ProjectScaffold

I added support for an initial renaming of the FSharp.ProjectScaffold and the FSharp.ProjectTemplate

I tested on both WIndows and Mac (no Linux though)

Hope this helps to make a lot more F# projects based on this awesome project template :-)

Regards Ramón

@ghost ghost mentioned this pull request Apr 26, 2014
@tpetricek
Copy link
Member

Nice work! It's great to see this - that should make the template much easier to use!

Here is a couple of thoughts how it could be improved IMO:

  • You had to implement a couple of helpers (moving directories, starting processes, etc.) As we already have FAKE in the template, it would make sense to use FAKE instead. It has pretty much all you need to copy & move files and directories around (see FileHelper documentation). Using that should make the script easier.
  • Also, I do not think that fsi.exe will always be available directly on the command line. So running the script via FAKE would take care of that. However, I think it would be good to keep this as a separate file (FAKE script) as it is (rather than adding that to build.fsx) so that people can easily delete the file once they are done.
  • FAKE also has helpers for calling git (search for "git" in the API reference). Although, I'm not sure if we should recommend that people clone the repository or just copy it and then re-initialize the GIT repo. We do not necessarily want to have all GitHub F# projects be cloned from this one - that does not make much sense, especially if the repo is completely different... but I'm not sure here.

@ghost
Copy link
Author

ghost commented Apr 26, 2014

Thx :-)

I was unaware that FAKE could be used for this script. I might create a v.2.0 that uses FAKE in a near future.

With regard to fsi.exe not being accessible from the command prompt, I would suggest that whenever the "SDK" for F# is installed, it also add the path to the binaries to the Windows environment PATH. At Delegate A/S we found this workaround but is a bit tedious to do on all machines and servers:

http://delegateas.github.io/Delegate.DAXIFsharp/setup_fsharp.html

@ghost
Copy link
Author

ghost commented Apr 27, 2014

@tpetricek

I removed the Windows Environment PATH dependency for rename.cmd:

@echo off
:: Add the paths for the F# SDK 3.x (from higher version to lower)
set FSHARPSDK=^
C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\;^
C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0\

cls
:: Execute the script "only" with the first "fsianycpu.exe" found
for %%i in (fsianycpu.exe) do "%%~$FSHARPSDK:i" rename.fsx %*

pause

Until I have the time to re-write a v.2.0, it will at least work on most of the Windows Boxes (so I think)

@tpetricek
Copy link
Member

Thanks!

I think that depending on whether you'll have time to look into this soon or not, we can either 1) wait a bit longer for a FAKE version from you or 2) merge the current version and create a new up-for-grabs issue for converting this to use FAKE (which you or someone else can do later).

let updateContent exts atomic' =
try
exts
|> Seq.map(fun x -> (root,x |> pattern') ||> files)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only works for cloned projects and not if .zip master is downloaded (fix this before merge)

@ghost
Copy link
Author

ghost commented Apr 27, 2014

@tpetricek I found a bug, see above

I will fix this, maybe tomorrow, and then it should be ready to be merged.

At the same time could you create a up-for-grabs for the FAKE version and assign it to me? This way I will have an excuse to learn FAKE :-)

p.s.: As I see it rename.fsx, rename.cmd and rename.sh will just be replaced with the new scripts whenever they are ready and until then, people will still be able to easily rename the FSharp.ProjectScaffold.

@ghost
Copy link
Author

ghost commented May 5, 2014

@tpetricek finally got the spare time to also add support for .zip Master :-)

p.s.: Please create a up-for-grabs for the FAKE version and assign it to me so I don't forget ...

@pblasucci
Copy link
Collaborator

Closing this as it has been superseded by #62

@pblasucci pblasucci closed this Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants