buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <ar...@intalio.com>
Subject Replacing VERSION/REQUIRES with version/dependencies and using YAML files to pick versions of specific libraries
Date Wed, 17 Sep 2008 00:26:02 GMT
A common request we get is being able to easily set a version for a
particular library.  For example, using JMock 1.2 instead of 2.0.
Right now that involves some tricky messing with the VERSION and
REQUIRES constants, which sometimes works, sometimes doesn't and never
feels quite right.


I decided to try something different, and use the build.yml file to
specify versions for 3rd party libraries.  With the new code you'll be
able to have a YAML file that reads something like:

jmock: 2.0
junit: 4.5

This will tell JUnit to use version 4.5, and JMock to use 2.0.  The
same is true for Ant, TestNG, JBehave, ScaleTest/Check/Spec, etc.

For example, Ant now has a build.yml setting which specifies which
version of Ant to use (the default being 1.7.1).  You can edit
build.yml to pick a different version that will always be used when
running this build.

There's no official API, but by convention you can get the version
number from Ant.version (was: Ant::VERSION) and the list of
dependencies from Ant.dependencies (was: Ant::REQUIRES).  These
methods are there in case the truly motivated need to mess with them,
maybe pick a random version of JUnit on each build, or replace JMock
with JSerious.


The change itself involved messing with a few files, and somehow ended
yak shaving a slight reorg.  Scala stuff now lives in buildr/scala and
the Buildr::Scala namespace, Groovy in buildr/groovy and
Buildr::Groovy.  Yes, they're all JVM languages, but piling all the
JVM languages into the java path didn't really help in managing the
code.

Similar change to the spec directory, mimicking the lib hierarchy, so
spec/java is separate form spec/packaging or spec/scala.  We have a
lot of code, this change get it a bit under control while testing the
new code, one language at a time.


I'm putting this first on Github for everyone to review, check, comment:
http://github.com/assaf/buildr/commits/master

The official issue is 148 (configure JUnit from YAML file), also
related to 140 (get rid of const_defined?), 115/138 (broken
repositories.local = )

https://issues.apache.org/jira/browse/BUILDR-148
https://issues.apache.org/jira/browse/BUILDR-140
https://issues.apache.org/jira/browse/BUILDR-115
https://issues.apache.org/jira/browse/BUILDR-138

Assaf

Mime
View raw message