Exploring various .NET build solutions: Albacore vs FAKE vs PSake

As I said in a previous post, I am changing our build process for our application, so I’m testing several build solutions.

FAKE is the newest and shiniest tool for .Net users. F# looks like a cross between Ruby (for the general syntax), and PowerShell (for the piping-fever-dream). Unfortunately, it seems to be missing a core piece of any proper build system: running an arbitrary exe file. I need to run the setup builder (InnoScript), but all I can find is creating a custom task, and it’s way overkill, and not very evolutive. Documentation is incredibly hard to find because of its generic name. Pro tip: do not name your software after a random generic word.

Albacore is great, running on Ruby, using Rake tasks. Installing Ruby on Windows is easy, as long as you don’t try to use some gems that won’t compile on your system. Unfortunately, Jenkins installed on Windows won’t run the ruby installed with Ruby Installer, for various reasons: PATH problems, rights problems, etc. Too bad, because my build script was working great.

PSake might be the easiest to use on a Windows build system. Documentation for PSake itself is very light, but Powershell is very well documented, very powerful, and we already use it in various places in our systems, so we know it pretty well.
The only thing I don’t like with Powershell is that, to keep things simple on one side, you have to do complicated things on the other. I don’t want to install a thousand plugins in Jenkins, so I need to build a batch “boostraper” that runs the PS scripts.

The good thing is that PSAke and Rake are very similar, so I was able to write the equivalent script in a few hours, just by putting my Rakefile and build.ps1 files side-by-side in Sublime Text.

Update

After a year working with PSake for all of my build scripts, I can confirm that it’s awesome. Powershell is a great automation language, it’s very mature, and it has thousands of libraries and extensions.

Rails is like magic…

… but more like black magic. The one where you have to sacrifice kittens to get anything done.

I want to do a simple thing using devise: authenticated users go to a page on the root of the site, and unauthenticated users go to another.
I’ve been banging my head for days on this. Between the various ways to do it, the different ruby, rails and devise versions that use different methods, it’s a mess. Nobody seems to agree on the best way to do it.

Well, I’ve found the way that I believe is the most simple.

Things to remember :

  • “devise_scope” is necessary. I do not understand why, nor what it does.
  • the “as: xxx” parts are necessary, too. It looks like Rails is fine with creating two routes pointing to the same URL, but wants different names for them. I would have tought that it would create these routes only at run-time.
  • do not modify several things at once and hope to understand what went wrong when everything crashes down, as long as you don’t understand the language and framework.

Building a .NET application for distribution

We have a Windows (WPF) app distributed to end users (general public).

I am changing the build process to simplify it. It is currently comprised of these steps :

  1. A SVN commit runs a Jenkins build
  2. Jenkins runs a few NAnt scripts
  3. NAnt builds the application through MSBuild
  4. It then launches a custom application that does several things:
    1. It downloads a few infos through a webservice, updates a DB, etc
    2. It modifies InnoSetup scripts with a few dynamic informations, like the version number
    3. It signs the binaries with a SSL certificate
    4. It launches the InnoSetup scripts to create the setup packages
    5. It signs the setup packages with the SSL certificate
  5. It then changes a few things before running the custom app again, in order to generate a different setup package

That’s quite a complicated and convoluted solution to a not-so-complicated problem. And, most importantly, it uses too much different technologies : I believe both the NAnt scripts and the custom application can be removed from the process.

So, I’m looking for a suitable replacement. I’ve had my eyes on Albacore for a few weeks, which looks very fun, and would allow me to use Ruby, which I might need to learn for later projects. But it has important problems:

  • It’s very light on documentation: the official wiki documents the V1, but it’s incompatible with the current V2, which is better. You have to look at the sources to see what’s available to you, and how to use it.
  • Help is hard to come by on the net.
  • It uses Ruby
    • it’s yet another layer in the build stack
    • it won’t allow me to get rid of the custom app (good luck updating an Access DB through a SOAP webservice)
    • runnig Ruby on Windows is easy, but many gems are not available (some of them very useful)

So now I’m looking at FAKE, which also looks promising. It has the huge advantage of allowing me to easily migrate the custom app (or simply reuse its components), because it’s .NET. But it also has problems:

  • Documentation does not seem much better, even though I haven’t yet started using it, so maybe it’s enough
  • Help seems to be even harder to come by, there seems to be even less FAKE questions on Stackoverflow than Albacore
  • It uses F#, which I don’t know at all, and won’t need in the future, but it’s always interesting to learn a new language (and apparently it’s the new kid on the block in .NET)

That being said, I will try FAKE anyway. It will allow me to remove build layers, and maybe remove the custom app. It will also probably be more easily adopted by the .NET community, especially since Scott Hanselman posted about it a few weeks ago.

Looking from the comments there, if FAKE does not work for me, I might want to try PSake: it’s in PowerShell, wich is a great scripting language, and I know pretty well already.