Message-ID: <1262261683.7553.1419232409767.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7552_1921655788.1419232409767" ------=_Part_7552_1921655788.1419232409767 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Gant is a tool for scripting Ant tasks using Groovy instead of XML to sp=
ecify the logic. A Gant specification is a Groovy script and so can bring a=
ll the power of Groovy to bear directly, something not possible with Ant sc=
ripts. 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 thin=
gs using Ant, but using a programming language rather than XML to specify t=
Here is an example Gant script:
In this script there are two targets, stuff and otherStuff -- the defaul= t target for this build is designated as stuff and is the target run when G= ant is executed from the command line with no target as parameter.
Targets are closures so they can be called as functions, in which case t= hey are executed as you expect, or they can be dependencies to other target= s by being parameters to the depends function, in which case they are execu= ted if an only if they have not been executed already in this run. (There i= s a page with some more information on Ta= rgets.)
You may be wondering about the stuff at the beginning of the script. Gan= t has two ways of using pre-built sub-scripts, either textual inclusion of = another Gant script or the inclusion of a pre-compiled class. The example h= ere shows the latter -- the class gant.targets.Clean is a class that provid= es simple clean capabilities.
The default name for the Gant script is build.gant, in = the same way that the default for an Ant script in build.xml.
Gant provides a way of finding what the documented targets are:
The messages on this output are exactly the strings associated with the = target name in the introduction to the target.
Gant used to be used for building and installing itself and is being use= d for various build tasks including building Groovy and Java programs, stat= ic websites, LaTeX documents, not to mention being an integral part of Grai= ls. The ability to have arbitrary Groovy methods within the scripts mak= es Gant so much easier to work with that the mix of XML and Groovy scripts = that using Ant necessitates. But then maybe this is an issue of individual = perception.
Gant is just a lightweight façade on Groovy's AntBuilder. I= t just a way of scripting Ant tasks using Groovy. Gant can be used to= do build tasks, but it doesn't have the integrated artefact dependency man= agement, project lifecycle management, and multi-module/sub-project support= that a fully fledged build framework should provide. Gradle on t= he other hand is a complete build framework based on Groovy and Ivy. = If you just want to do some Ant task scripting then Gant is probably the to= ol you need, but for replacing Ant and Maven as build frameworks (so as to = get rid of all the XML and use Groovy), then you probably need to consider = = Gradle.
And yes, Gant is managed by a Gradle build.
It is probably worth noting that Gradle grew out of work done on Gan= t.
Prepackaged Distribu= tions are for those who want to "load and go".
Developer Access is for t= hose who want to be right on the cutting edge.
If you give Gant a go and have some feedback, do let us know on the Gant= User mailing list or perhaps the Groovy User mailing list.
If you have any issues with Gant then please add a JIRA issue into the G= ant JIRA at Codehaus. The URL is http://= jira.codehaus.org/secure/CreateIssue!default.jspa|http://jira.codehaus.org/= secure/CreateIssue!default.jspa