Gant to Ant automagically

On more than one occasion, I’ve been asked by various hip developers if there was a conversion script for transforming existing Ant build files into Gant build files. Russel Winder, the copasetic guru behind Gant updated the Gant website with a link to a trippin’ script (dubbed ant2gant.groovy) that’ll do just that, baby!

I tested it out with a normal Ant build file and it worked like a charm– just make sure you have in your classpath:

  • ant.jar (I used 1.7.0)
  • ant-launcher.jar (I used 1.7.0 as well)
  • commons-cli.jar (I used 1.1)

Also too, my Ant build.xml file had a path element living outside of a target like so:

<path id="build.classpath">
 <fileset dir="lib">
  <include name="**/*.jar"/>
 </fileset>
</path>

This was causing the script (really Ant’s Project object) to blow up; consequently, I moved it into an initializing target and things worked copasetically from there.

If you haven’t tried Gant yet and you find yourself beating your head against the wall when it comes to adding behavior to Ant (such as looping, etc), then give your head a rest and take a look at Gant– this is a smokin’ tool that adds a refreshing level of flexibility and expressiveness to Ant (using Groovy, man!).

Related odds and ends
 

2 Responses to “Gant to Ant automagically”

  1. on 29 Apr 2008 at 1:32 pm heli

    shouldn’t the title be ant to gant automatically?

  2. on 05 May 2008 at 12:06 pm Andy

    Indeed, it should, baby!

Trackback this Post | Feed on comments to this Post

Leave a Reply