h1ghlevelb1ts

buildr overview

Tonight I spent a couple of hours at Jayway listening to Anders Janmyr talking about buildr - the build system that doesn't suck. buildr is a build system for Java and a whole bunch of other languages. It is written in Ruby and installs as a gem. Build scripts are also Ruby with everything that comes with it. It is built with the good things of maven as role model and with the less fortunate aspects of maven as frightening example. Dependencies are downloaded from maven repos and local builds can be installed to a local maven repo. To try it out I cd'd into a directory with a maven pom.xml and ran buildr. It gave me the choice of creating a build file from the maven pom or from the directory structure. When choosing maven pom the generated build file was about half the size of the pom. Now this was used on a very simple pom and according to Anders it may not work at all with more complex maven projects. buildr can do all the typical tasks of a build system and if something extraordinary is needed it is easy to script it with ruby.

Some advantages of buildr: (1) it is Ruby which enables "real" programming in build files, (2) it is Ruby which makes it possible to write build files that looks really nice (3) it is not XML - anyone tired of scripting in XML? (4) it includes the good parts of maven. Some disadvantages: (1) it is Ruby which may result in Perlish code if not careful, (2) it is not Java and XML (thank God) which may make it hard to introduce in larger organisations with static developers. If I was to pick a build system for my own use I would choose buildr but then I perhaps wouldn't choose Java as and the need wouldn't be there.... For larger organisations with competence problems it may be hard to introduce buildr over maven or ant. The threshold into ruby may be a little bit too high for the average java developer.

Anders also went through cucumber - a really nice testing tool that non-dev people can understand - and rake - Ruby make. "rake -T" will be remembered - it will come in handy when forgetting the howtos when coding rails in spare hours.

UPDATE: Peter Lind pointed in two more alternatives to buildr. If you use JRuby you can use Ant and Rake interchangeable as described in this post. Advantages with this approach is that you rely entirely on stable technologies. buildr is a bit new and may not work for all cases yet. And then - of course - there is polyglot maven that promises to: "to leverage the power of Maven through modern JVM language implementations like Groovy, Scala, Clojure and JRuby". Seems like everyone is heading in each others directions.....

PS. Jayway is hiring junior Java developers with 2-5 years of experience. Someone in the audience translated this to "cheap"....

 

Old comments

2010-02-25Hardy Ferentschik
Interesting. I need to give Buildr a go. I have been playing with Gradle which is based on Groovy. Again the idea is to take the good things of Maven and add real scripting into the mix. Seems everyone agrees Maven brought important features into building projects, but got along the way a few things wrong. The big question is who is winning the post Maven game.