Skip to: Site menu | Main content

Gant

Xircles | Mailing Lists | Confluence | JIRA | Source

A Groovy-based build system that uses Ant tasks, but no XML.

Ant Task Print

The Hudson continuous integration system can use Gant files directly to initiate builds.  The Buildbot continuous integration system uses a shell to initiate builds and so Gant can be used directly. However, often the only way of initiating a build on a continuous integration server is via Ant (or Maven). People can still use Gant by making use of the Groovy Ant task, creating a Gant instance and calling processTargets on that instance. However many would see that as rather awkward, so the Gant Ant task is provided. The Gant jar contains the Gant Ant task:  org.codehaus.gant.ant.Gant.  With the Gant jar in the class path, we can create an instance of the Gant Ant task by:

<taskdef name="gant" classname="org.codehaus.gant.ant.Gant"/>

Use the classpath or classpathref attribute or nested tags as needed in the usual way.

The Gant Ant task supports the following attributes:

Attribute Optional Default value
file yes build.gant The path to the Gant file to use.
target yes default The target to achieve.

Currently the Gant Ant task does not recognize any nested tags.

As an example, explicitly stating both the file and the target a Gant build can be initiated from an Ant script by:

<gant file="build.gant" target="test"/>

Because of the defaults this is equivalent to:

<gant target="test"/>

If the Gant file specifies the test target as the default target then this is equivalent to:

<gant>