You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Thirumurugan Rengasamy <mu...@chipdata.com> on 2000/07/18 18:21:41 UTC

Build from Build!

Hi!

I want to build the other build.xml files (which are in sub direcories of
this base dir.) from the base build.xml in the base dir.

How can I include that build.xml's(more than one!!) targets in the single
target of the base build.xml?

Thanks in adavance!

-- Murugan.



Re: Build from Build!

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "TR" == Thirumurugan Rengasamy <mu...@chipdata.com> writes:

 TR> How can I include that build.xml's(more than one!!) targets in
 TR> the single target of the base build.xml?

You are right, the <ant> task only supports one target. There are
several ways you can work around this limitation (if it is one). 

Two ways you could invoke more than one target:

(1) Use an <exec> task to start Ant and specify more than one
target. You will find that this approach has its own limits and
drawbacks.

(2) In your sub buildfiles create empty targets that depend on the
targets you wanted to specify. I.e. if you wanted to use something
like (which doesn't work)

<ant dir="subdir" target="target1,target2" />

make that

<ant dir="subdir" target="compoundtarget" />

with

<target name="compoundtarget" depends="target1,target2" />

in subdir/build.xml.

I feel this second approach is even clearer than allowing more than
one target to the <ant> task.

Comments?

Stefan