FAKE impressions

August 8th, 2011

Weird post title, I know. But I refer to FAKE – F# Make.

It’s a nice and simple library to perform usual build related tasks. The fact that it’s pure F# makes it quite powerful – have you tried doing complex stuff with NAnt or MSBuild? If so, you know what I mean. Xml is *not* a programming language.

FAKE is simply organized as a collection of modules, each exposing related functions and|or operator overloads. So it’s not exposed in an OOP fashion, rather in a very flat public surface. That *may* make up for the lack of documentation. It’s somewhat easy to understand how things work by browsing the source – for those who are comfortable with that.

That said, in my first experience I couldn’t get the FileSet to generate any result. I also couldn’t find a way to turn on a more verbose logging. I went on a trial-and-error and realized the fileset was missing a BaseDir setting.

Since I’m a big fan of F# Project Extender, which adds metadata to define the order of the build items that are not recognized by MSBuild. So I managed to create a FscTask that takes that in consideration. In the process I noticed how FAKE lacks a few common NAnt features, such as resolving reference assemblies. I guess the author didn’t need them, which is fair in the OSS world. That said, a simple Fsc.exe invocation turned into a sizable task.

My fsc task is dirty and ugly, so beware. You can find it here. For now I’m sticking to Fake for MR builds and see how it goes.

Categories: .NET, F# | Top Of Page | 2 Comments » |

2 Responses to “FAKE impressions”

Gian Marco Gherardi Says:

You can also give a look at JSMake, a simple Javascript build program with capabilities similar to make. I use it to build all my .NET projects


Chris Nicola Says:

I loved Fake when I played around with it a while back. I was looking to replace a really complex NAnt mess at the time with either psake or fake. I greatly preferred Fake, PS scripting is brutally verbose and ugly to me. However Fake didn’t have much functionality for a lot of common build tasks and I couldn’t find the time to add it in.

I had trouble with something as simple as manipulating the Assembly.cs files. You can see my comments here:

With sufficient utility functions Fake could be pretty awesome.

Leave a Reply