Versions Compared

Key

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

 Gant 1.9.

...

10 released,

...

2013-11-

...

22T14:

...

08:00+00: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
)

In this script there are two targets, stuff and otherStuff -- the default target for this build is designated as stuff and is the target run when Gant is executed from the command line with no target as parameter.

...

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.
| >

...