OMG, Better Rake (for .net)!

If you ask me, when it comes tools for writing automated build scripts nothing packs more bang for the buck than Rake. Until recently, using Rake to build .net solutions required a magic concoction of hacked together scripts which rarely exhibited Ruby’s appreciation for beauty nor Rake’s spirit of simplicity.

Luckily our buddy Derick Bailey decided it was time to bite the bullet and start building some real Rake tasks that were special suited for building .net code. The result is Albacore.

Using Rake for .net IRL

I’ve been using Rake to be lazy for a while. And we, the VersionOne dudes & dudettes, have been using it to help automate our CI builds for over a year now. And just last week we started ditching much of our hacky-Rake-script inventory in favor of more concise, tested, and readable Rake tasks via Albacore.

During the migration I’ve run into a few small hitches here and there, but nothing that I couldn’t track down, write a test for, and fix within a couple of tomatoes. In one case I discovered an issue, called Derick to confirm, suggested a fix, and had a new Albacore Gem published within a couple of hours. Hawt!

Albacore already has a decent number of tasks baked in, and the list is growing all the time!

  • AssemblyInfoTask - Generate an AssemblyInfo.cs file. Currently only supports C#
  • ExpandTemplatesTask - expand template files with #{setting} markers, using YAML configuration files as the data
  • NCoverConsoleTask - Run code coverage analysis through NCover’s NCover.Console
  • NCoverReportTask - Check code coverage and get detailed reports through NCover’s NCover.Reporting
  • NUnitTask - run NUnit test suites
  • MSBuildTask - Build a Visual Studio solution (.sln) or MSBuild file
  • Rename Task - Rename a file
  • SftpTask - Upload a file to a remote server via secure FTP connection
  • SQLCmdTask - Run scripts and other commands through SQL Server’s sqlcmd.exe
  • SshTask - Run a command on a remote system via a secure shell connection
  • ZipTask - Package your build artifacts into a .zip for easier distribution source data


As we move more and more of our custom stuff over I’ll continue to add features to Albacore, enhancing the great work the core team is doing. In fact, I’m already planning a NAnt task to help those folks in the process of migrating from an existing NAnt-based build script to Rake. Look for it soon!