fsprojects / FAKE

FAKE - F# Make
https://fake.build
Other
1.28k stars 582 forks source link

Add Documentation for build.fsproj pattern #2695

Closed aboy021 closed 1 year ago

aboy021 commented 1 year ago

Description

I've recently moved from using the FAKE script runner to having a stand alone build.fsproj project that uses FAKE libraries. It's an approach that others have been using, and I've found it to be excellent so far. It would be great if there were some documentation on the Project Home Page on how to do this.

The following projects both use the build.fsproj approach, albeit somewhat differently:

There was some mention of this approach in issue #2627, and it is a good work around.

There's an question on Stack Overflow (visual studio code - Fix for "Package manager key paket was not registered" in build.fsx) where the maintainer for Ionide suggested a few solutions including using a "build project".

I wrote an answer to the StackOverflow question sharing some basic steps on how to use the build.fsproj approach.

I'd really like to see this approach become a first class option as it gives a great debugging experience, even in Visual Studio, and seems to have better tooling support.


Repro steps

N/A

Expected behavior

N/A

Actual behavior

N/A

Known workarounds

N/A

Related information

N/A

github-actions[bot] commented 1 year ago

Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!

yazeedobaid commented 1 year ago

Thanks a lot for suggesting the solution. Yes, absolutely we can add this approach to the different ways that FAKE can be used. I like the structure of your answer in StackOverflow. Would you like to send a PR with it?

By the way, we are currently experimenting with the solution of using dotnet fsi directly instead of the FAKE runner. Since now FSI supports resolving dependencies from the script, even with Paket by adding it to the dependency managers list on the machine. However, this has the drawback of caching and speed of running the script. So FAKE runner compiles the script on the first run and for subsequent runs, it uses the compiled assembly, hence the compilation phase is skipped.

yazeedobaid commented 1 year ago

I added the build project installation approach in the documentation, Run FAKE using a dedicated build project. Please feel free to update it if I'm missing something. Thanks!