ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Reason" <>
Subject RE: Convention for laying out an ANT build script
Date Wed, 02 Apr 2003 01:24:36 GMT

I too am new to ANT and have been wrestling a 600 line build.xml.

A couple of things have made life easier.  First, download a trial of
XMLSpy from  Go to View >> "text view".  Then go to Edit
>> "pretty-print-xml-text" and your build.xml will be formatted
consistently.  It also removes a lot of needless and confusing white
space, so you're file may get way smaller.

Second, it's good to have targets divided into logical steps.  And
sometimes one step really does depend on the one before it.  But other
times either A) the depend clause isn't 100% necessary or B) both
targets should be combined into one.  If you're ALWAYS going to run
target A+B, then make it one target.

Also, in XML spy, feel free to cut and paste the targets into a more
readable order.

Then go to View >> "Enhanced Grid View".  This will give you a great and
compact view of your buil.xml.  You can expand any element you want to
see more detail, or keep it rolled up.  It's great for getting a
high-level of the build.

Hope this helps,


-----Original Message-----
From: Andrew Zeon [] 
Sent: Tuesday, April 01, 2003 5:21 PM
To: ''
Subject: Convention for laying out an ANT build script


I'm new to ANT. One thing I find difficult about ANT is tracing an ANT
build script. Our company has a very long (500 lines) ANT script for
build and deploy. However, whenever I need to trace through it to modify
it, or debug it, I find myself jumping all over the build file because
of dependencies. For this reason, using ANTCALL seemed like a better
alternative. However, I have faced many problems using ANTCALL
(particularly with properties). For some reason, properties declared in
my init target are not accessed by targets called by ANTCALL unless the
called target depends on the init target. 

What is the common convention for laying out an ANT build script? Build
scripts can get awfully long... Is it a good or bad idea to have
multiple ANT scripts so that files are smaller hence easier to manage?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message