ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Lord <>
Subject re-reading build file from within ant
Date Thu, 19 Jun 2003 17:05:50 GMT

I'm currently using a tool** that generates my build.xml file for me
from a couple of other source files

This works quite nicely but has one problem. I am using ant itself to
check when the source files for the build.xml file get out of
date. This works fine, but rest of the build gets run according to the
old build.xml which has already been loaded and parsed. So you have to
run the build twice (once to regenerate the build.xml, and once to
actually do the build). Which is a pain. 

The best I have come up with is this...

1) run the build. If the build.xml file is updated, run ant again with
   the <ant> task. When this completes, fail in the current build. 

This will result in a failure message, even if the internal build
succeeds, which is messy, and also I don't know how to get the targets
sent to the command line for the original ant, so I can't launch the
internal one properly. 

2) Just fail if the build.xml gets rebuilt. 

This is not a good user experience!

3) Use an external script instead of ant. This will run ant twice,
   once to update build.xml if needed, and secondly to actually run
   the build. 

And this requires people to change their IDE to not launch ant
directly, which is a pain. 

Has anyone got any better ideas?


** The tool is called antmerge, in case anyone is interested..

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

View raw message