Albacore - build .Net application with Rake
Rake is very popular in Ruby community framework to automate the building process.
Rake provides interesting language (internal DSL programmed in Ruby) to describe the build routines.
Albacore is suite of Rake tasks that are very useful to build .Net application like running MSBuild, updating AssemblyInfo and etc.
How to start
First need to setup environment
1. Install Ruby - I used IronRuby (http://ironruby.codeplex.com/) but it's not must
2. Install next libraries with Gem (in case of IronRuby use igem)
1. Install Rake with next command
igem install rake
2. Install Albacore with next commands
igem install albacore
All installed Ruby utilities (like 'igem' or 'rake') are located in Ruby setup folder (for ex. C:\Program Files\IronRuby 1.0v4\bin)
Define sample build
Sample build will update release version and build solution with MSBuild.
require 'rubygems'
require 'albacore'
namespace :albacore do
desc "Build project"
task :sample => ['albacore:assemblyinfo', 'albacore:msbuild']
desc "Build solution with MSBuild"
Rake::MSBuildTask.new(:msbuild) do |msb|
msb.properties :configuration => :Debug
msb.targets [:Clean, :Build]
msb.solution = "AutoMapperStuff.sln"
end
desc "Update assembly info"
Rake::AssemblyInfoTask.new(:assemblyinfo) do |asm|
asm.output_file = "Properties/AssemblyInfo.cs"
asm.version = "1.2.3.4"
asm.copyright = "Copyright (c)2009 MyCompany."
end
end
Save the build file as rakefile.rb in project folder.
Run sample build
Go to project folder(cd) and run the build process with next command
rake albacore:sample
Albacore project site http://albacorebuild.net/
Interesting post about Albacore v0.2.0 from Derick Bailey http://www.lostechies.com/blogs/derickbailey/archive/2010/07/14/albacore-v0-2-0-preview-1-is-available.aspx

Comments
Hey Michael,
FYI - the version of Albacore and the code you've listed are very outdated. The github gem server hasn't been updated in a significant amount of time, and there are some much more advanced features and capabilities in albacore than what you've shown here. I recommend not using the github server anymore. RubyGems.org is the official repository of gems and Github has dropped support for updating their gem server, in favor of RubyGems.org. With that, there is no need to setup github as a gem server. any default ruby install will allow you to retrieve the latest version of albacore by running "gem install albacore"
Beyond that, there are many syntax changes and other great additions to albacore in recent releases that you'll want to check out. the Wiki page that you linked to has information on the latest official release (v0.1.5) and I have a recent blog post on a preview release that makes albacore even easier to configure and use: http://www.lostechies.com/blogs/derickbailey/archive/2010/07/14/albacore-v0-2-0-preview-1-is-available.aspx
thanks for using and advocating for albacore! it's always a nice thing to see people blogging about the tools and frameworks that they use. :)
Hi Derick.
Thanks for your comment - I will update the links.
Currently I don't use Albacore in production but it's very interesting and promising project.
I like the Rake way to define build process with DSL and not in xml like in Ant.
A lot of thanks for realy "cool" tool !
By the way what do you think about FAKE that uses F# as DSL(http://www.tikalk.com/net/fake-fake)?
Is it competitor to Albacore?
while i haven't used fake for any actual projects, i do like it. there's a lot of great build tools out there: fake, psake, bake, rake, and many more... i don't really see these tools as "compeititors" anymore. rather I see them as options that play to the strengths of the team and environment.
I've often suggested people use Psake instead of Rake and Albacore, actually. after discussing their situation and their team, it becomes apparent that they are more comfortable with powershell than with a bash shell. that often makes psake a better choice.
it's not about which tool is better, these days. it's all about which one fits the team and the environment.