“FAKE – F# Make” is intended to be an extensible build framework. That’s why I tried to make it as easy as possible to create custom tasks. This posts shows how we can create a (very simple) custom task in C# which gives a random number.
Open Visual Studio and create a new C# class library called my MyCustomTask and create a class called RandomNumberTask:
Now compile this project and put the generated assembly into the tools/FAKE path of your project. Now you can use your CustomTask in the build script:
You can use every .Net class with FAKE. Just put the assembly in the right folder (tools/FAKE) and include it with the #r command.
If you want to use FAKE’s standard functionality (like globbing) within your CustomTask project, just reference FakeLib.dll and explore the FAKE namespace.
Tags: F#, F-sharp Make, Fake, MSBuild, NAnt

