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 = "184.108.40.206" 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
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