Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 Gant 1.9.

...

8 released,

...

2012-

...

06-

...

28 09:

...

50:00

...

-04:00

Gant is Groovy Ant Scripting

Gant is a tool for scripting Ant tasks using Groovy instead of XML to specify the logic. A Gant specification is a Groovy script and so can bring all the power of Groovy to bear directly, something not possible with Ant scripts. Whilst it might be seen as a competitor to Ant, Gant uses Ant tasks for many of the actions, so Gant is really an alternative way of doing things using Ant, but using a programming language rather than XML to specify the rules.
Here is an example Gant script:

Code Block

includeTargets << gant.targets.Clean
cleanPattern << [ '**/*~' ,  '**/*.bak' ]
cleanDirectory << 'build'

target ( stuff : 'A target to do some stuff.' ) {
  println ( 'Stuff' )
  depends ( clean )
  echo ( message : 'A default message from Ant.' )
  otherStuff ( )
}

target ( otherStuff : 'A target to do some other stuff' ) {
  println ( 'OtherStuff' )
  echo ( message : 'Another message from Ant.' )
  clean ( )
}

setDefaultTarget ( stuff )

...

Gant provides a way of finding what the documented targets are:

Code Block

| > gant -p
clean       Action the cleaning.
clobber     Action the clobbering.  Do the cleaning first.
otherStuff  A target to do some other stuff
stuff       A target to do some stuff.

Default target is stuff.
| >

...