| How to avoid <antcall > with generic <script > target for subprojects? | How to avoid <antcall > with generic <script > target for subprojects? 2003-03-27 - By Andreas Ames
Hi,
I've followed Jim White's advice on how to call <ant> generically on a list of subdirectories from within the build.xml of a superproject (see http://marc.theaimsgroup.com/?l=ant-user&m=102346699504250&w=2; however, fwiw, I'm using jython). The only thing, I'm not satisfied with, is the way to set the target(s) for the different <ant> calls. The mentioned recipe uses <antcall> for this and I'd rather avoid that one, because:
1) I'm not sure about the properties and references and how they are inherited or not; that is I need the exact sets of properties and references as they are when the <antcall> occurs, (obviously with one new property that contains the target(s) to build in the subprojects) so I believe I must inherit them but then 'ant -v' warns me about properties not being overwritten; afaik (I'm new to ant) I can ignore these warnings, but it just 'feels' not right
2) it parses the build.xml once more
So I would like to avoid these <antcall> tasks but I don't know how to do it esp. when I want to be able to call
ant build clean
and both commandline targets are configured to recurse into the subprojects, because the ant property, which specifies the target(s) for the subprojects, is immutable (as all ant properties, afaik). So is there any known pattern how to achieve this without the need to use <antcall>?
TIA,
andreas
|
|
 |