This is a PowerShell script to comprehensively set up an environment to use Fake
- Download the script into the folder wher you want to implement your build system
- Open Windows PowerShell
- Put down
.\build.ps1 -CreateDraftFsx
The current folder has all the infrstructure to use Fake right away:
- The latest stable version of Fake is downloaded
- Fake.exe and FakeLib.dll are in ".\packages\FAKE\tools"
- A draft of a build script is created and named as
build.fsx
Fake can also be used via this script. All that need to be done is to invoke the script with necessary Fake's parameters. For instance: .\build.ps1 Clean
will invoke the Clean task of build.fsx
.
You can can also optionally provide the Script
parameter to specify the name of the build script. For instance, the alternative to .\build.ps1 <Task> <FakeArguments>
but with a specified script is the following command: .\build.ps1 -Script my_test.fsx <Task> <FakeArguments>
(or even easier .\build.ps1 my_test.fsx <Task> <FakeArguments>
)
From all the ways offered on the official web-site, the paket approach appealed to me most of all because:
- I don't want to have all memebers of my team install chockolotey and Fake globally
- I also don't want to have a .Net Core locally or make anybody install it
So the script downloads Paket to the current folder and set up all necessary infrastructure to use it:
paket.exe
can be found under the.paket
folderpaket.dependencies
andpaket.lock
are created in the current folder
Considering this, you will have to add .paket
to your .gitignore
and add paket.dependencies
and paket.lock
to your repository
Also if you specify the -CreatedDraftFsx
parameter then the script also creates a blueprint of a build script with examples of tasks. By providing the Script
parameter, you can control the name of that script.