INFO

Before running any specific target it is useful to know all the targets that are available in a build script.
FAKE can list all the avaiable targets including the dependencies by running the following command:

Fake.exe YourBuildScript -lt

The option -lt stands for "list targets". It is an abbreviation of the option --listTargets.

FAKE can output the graph of target dependencies in the DOT
format, which can then be rendered to a PNG-file by Graphviz.

Specifying the command line option --dotGraph (short version: -dg) makes FAKE write
the dependency graph to the standard output instead of building anything. This option only works when
the build script contains a call like this:

Since multithreading is beneficial (especially for large projects) FAKE allows to specify the
number of threads used for traversing the dependency tree.
This option of course only affects independent targets whereas dependent targets will
still be exectued in order.

The number of threads used can be set using the environment variable parallel-jobs.
This can be achieved in various ways where the easiest one is to use FAKE's built-in support for
setting environment variables:

FAKE.exe *YourBuildScript* "parallel-jobs=8"

Note that the dependency tree will be traversed as usual whenever setting parallel-jobs to a value <= 1 or omiting it entirely.

Running targets in parallel is of course only possible when the target-functions themselves are thread-safe.

Parallel execution may also cause races on stdout and build-logs may therefore be quite obfuscated.

Error detection may suffer since it's not possible to determine a first error when targets are running in parallel

Due to these limitations it is recommended to use the standard sequential build whenever checking for errors (CI, etc.)
However when a fast build is desired (and the project is e.g. known to build successfully) the parallel option might be helpful

When using this parallel option, Fake resolves the build dependency hierearchies from the described paths and builds independend paths as parallel if you have multiple CPUs available.
For example this dependency tree:

"FAKE - F# Make" is intended to be an extensible build framework and therefor it should be as easy as possible to create custom tasks.
This tutorial shows how to create a (very simple) custom task in C#.

Compile the project and put the generated assembly into the tools/FAKE path of your project. Now you can use your CustomTask in the build script:

1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:

// include Fake libs#I@"tools\FAKE"#r"FakeLib.dll"// include CustomTask#r"MyCustomTask.dll"openFake// open CustomNamespaceopenMyCustomTask// use custom functionalityRandomNumberTask.RandomNumber(2,13)|>tracefn"RandomNumber: %d"