Rake is a quite popular build framework, that has its strengths in the fact that it is code (no more xml), and it is very simple to get started with. Actually setting it up is a 3 step process.
- Make sure the path environment variable is set to point at your ironruby/bin folder.
- Run “igem install rake” from the commandline
- Write a Rakefile.rb like the following and place it at the root of your site
require 'rake'
task :default => [:say_hi]
desc "Does quite a bit of greeting"
task :say_hi_to_me do
puts "Hello me. Now that was easy."
end
task :say_hi_to_world do
puts "Hi world!"
end
task :say_hi => [:say_hi_to_me,:say_hi_to_world] do
puts "I’m, all hellowed out"
end
This really all it takes, so now you are ready to run your tasks from the commandline by writing: “rake” or “rake say_hi_to_me”.
Now for this to get really interesting you will need albacore which makes it easy to do all kinds of basic tasks.
This is installed with the command “igem install albacore”, and makes it possible to do builds and run unittests like this:
require 'rake'
require 'albacore'
task :default => [:full]
task :full => [:clean,:build_release,:run_tests]
task :clean do
FileUtils.rm_rf 'build_output'
end
msbuild :build_release do |msbuild|
msbuild.properties :configuration => :AutomatedRelease
msbuild.targets :Build
msbuild.solution = "TestApp/TestApp.sln"
end
nunit :run_tests do |nunit|
nunit.path_to_command = "tools/nunit/nunit-console.exe"
nunit.assemblies "build_output/TestAppTests.dll"
end