require 'rakeoff' SESSION = Session.new task :default => [:clean, :tokens, :compile, :aspnetcompile, :unit_tests]
That's it, nothing else... To install it:
$ gem install rakeoff
It can be like this for every project you have. It should hugely reduce repeating yourself, configuring test runners, compilation, versioning etc... and in general the amount of code you need to maintain.
A while ago I wrote an article at Huddle about build conventions. These were aimed to:
- Reduce repetition in build scripts
- Make it faster to get a project building
- Easier to switch between projects as they apply roughly the same rules
- Strip out the dependency on the developer having to remember to add things to build scripts (and instead do it via convention)
- Give clear, easily readable and understandable output when building
Why The "Session"?
The initialising of the session variables used to kick off the second you called rake, without even needing an explicit reference. This worked well, it just meant you had a heavy overhead to start rake, especially if you want to run a task that doesn't use the conventional tasks.
So, while not ideal, I created an "Session" class. This initialises any session variables and creates any dynamic tasks.