Java Reference
In-Depth Information
}
warName = "${basedir}/${fileName}.war"
}
ant.delete(file:warName, failonerror:false)
}
This is straightforward Groovy code that simply defines some variables and sets their prop-
ertiesbasedonthecurrentconfiguration,andtheninvokesthe delete methodonthe ant
object.
That's enough Gant for this topic. [ 5 ]
5 Additional information on Gant can be found at the Groovy website. There's also a decent tutorial in the topic
Grails in Action (Manning, 2009), by Peter Ledbrook and Glen Smith. Finally, the Grails user guide has a section on
creating Gant scripts specifically for Grails.
5.3.5. Ant summary
That also concludes the discussion of Ant and Ant-based approaches, both in Java and
Groovy. The “Lessons learned” sidebar shows the details.
Lessons learned (Ant)
1. If you have an existing Ant build, you can add <groovyc> and <groovy> tasks
to it.
2. Gant is only used by Grails, and not for very much longer.
3. AntBuilder is rare by itself but is built into and useful in Gradle
It's time now to examine the other major build tool in the Java world: Maven.
Ant limitations
When it was released Ant was a major improvement over previous build processes. Still, it
has major issues that complicate life, especially in larger builds. Here's a brief list of com-
plexities associated with using Ant. This is not intended to be a criticism of Ant, but rather
to highlight the issues that lead to the next-generation tools.
 
Search WWH ::




Custom Search