Specifying both multiple targets and multiple build files with ant or subant in 1.6
- by Paul Marshall
I'm trying to unify a build process, running one build to get multiple packages. My first shot at this is just having a central build script call <ant or <subant on each project's build.xml file. I'm using Ant 1.6, and I've run into a funny problem: either I use the <ant task, and I can specify multiple targets but not multiple build files, or I use the <subant task, and I can specify multiple build files but not multiple targets.
I realize there's a few solutions here already:
Just upgrade to Ant 1.7 already; <antcall can do multiple targets there.
Edit the separate project build files to have a variety of top-level targets, so I can call each individual file with just one target, and use <antcall.
Copy-paste a lot of <ant tasks, with a little help from <macrodef to help the sanity.
Is there something I've missed, that will allow me to do what I want from this single central build.xml without a) editing individual project files, b) writing lots of repetitive code, or c) upgrading Ant, and that d) doesn't require editing every time I add a new project?