Three Types of Ant Scripts
By Adrian Sutton
Bryan comments on the three types of ant scripts:
In my experience, there are three types of Ant scripts that you encounter “in the wild”:
- Small Ant scripts, generally Java-only, which can use most of Ant’s default behaviors and are clear and simple. A lot of open source build scripts are this way.
- Serious commercial Ant scripts written before macrodef and import became available. These are generally impossible to understand and evolve, and the reality is that a small cadre of Build Wizards keep them running. Such systems often involve a substantial number of custom Ant tasks.
- Serious commercial Ant scripts written to use macrodef and import. In my experience, the need for custom Ant tasks drops way off with Ant releases post-1.6.
This really does ring true to me. Ant scripts can fairly quickly become unwieldy and difficult to work with if you aren’t using import and macrodef, but with them you can achieve so much more without the complexity getting out of hand. They won’t absolve you of the need to properly understand ant and the declarative paradigm it wants you to work with, but it’s much more approachable.
If I can ever get someone to add the optional dependencies for scripting support on our build servers1{#footlink1:1264152423184.footnote} I may well find they help a lot too.
1 – which happen to be Windows boxes, behind a firewall on the other side of the world from me, so not easy to make remote changes on ↩