You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by videophool <na...@beloved5.com> on 2010/06/03 20:16:30 UTC

using subant with multiple projects with specific build order

I am new to ant, and am setting up a master build.xml.  There are several
projects (each with build.xml) that the master will build, and there is a
dependency chain so that they must be built in a specific order.  All of the
subant examples that I find use dirset which does not allow control of the
build order.  I have hacked a working build.xml, but I will add multiple
targets, and I do not want to copy/paste the hack.  What I want to do is to
define the collection of project folders outside of the subant block, and
then use that collection with subant.  See my current hack below.
 
 
 
&lt;project name="master"&gt;
 
  &lt;target name="all"&gt;
    &lt;subant&gt;
      &lt;target name="build"/&gt;
      &lt;target name="publish"/&gt;
      &lt;fileset dir="./Proj1Folder" includes="build.xml"/&gt;
      &lt;fileset dir="./Proj2Folder" includes="build.xml"/&gt;
      &lt;fileset dir="./Proj31Folder" includes="build.xml"/&gt;
      &lt;fileset dir="./Proj4Folder" includes="build.xml"/&gt;
    &lt;/subant&gt;
 
  &lt;/target&gt;
 
&lt;/project&gt;
 
 
-- 
View this message in context: http://old.nabble.com/using-subant-with-multiple-projects-with-specific-build-order-tp28771184p28771184.html
Sent from the Ant - Dev mailing list archive at Nabble.com.

Re: using subant with multiple projects with specific build order

Posted by videophool <na...@beloved5.com>.


Jeffrey E Care wrote:
> 
> videophool <na...@beloved5.com> wrote on 06/03/2010 02:40:12 PM:
> 
>> > IIRC you can use a filelist to enforce ordering.
>> > 
>> 
>> Any details or sample code would be greatly appreciated.  Especially
>> declaring the filelist once and using it for multiple targets.  Thanks.
> 
> The manual has information about declaring & using references.
> 

The manual, wow!  Thanks for the great info.
-- 
View this message in context: http://old.nabble.com/using-subant-with-multiple-projects-with-specific-build-order-tp28771184p28771549.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: using subant with multiple projects with specific build order

Posted by Jeffrey E Care <ca...@us.ibm.com>.
videophool <na...@beloved5.com> wrote on 06/03/2010 02:40:12 PM:

> > IIRC you can use a filelist to enforce ordering.
> > 
> 
> Any details or sample code would be greatly appreciated.  Especially
> declaring the filelist once and using it for multiple targets.  Thanks.

The manual has information about declaring & using references.

Re: using subant with multiple projects with specific build order

Posted by videophool <na...@beloved5.com>.


Jeffrey E Care wrote:
> 
> videophool <na...@beloved5.com> wrote on 06/03/2010 02:16:30 PM:
> 
> IIRC you can use a filelist to enforce ordering.
> 

Any details or sample code would be greatly appreciated.  Especially
declaring the filelist once and using it for multiple targets.  Thanks.
-- 
View this message in context: http://old.nabble.com/using-subant-with-multiple-projects-with-specific-build-order-tp28771184p28771415.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: using subant with multiple projects with specific build order

Posted by Jeffrey E Care <ca...@us.ibm.com>.
videophool <na...@beloved5.com> wrote on 06/03/2010 02:16:30 PM:

> I am new to ant, and am setting up a master build.xml.  There are 
several
> projects (each with build.xml) that the master will build, and there is 
a
> dependency chain so that they must be built in a specific order.  All of 
the
> subant examples that I find use dirset which does not allow control of 
the
> build order.  I have hacked a working build.xml, but I will add multiple
> targets, and I do not want to copy/paste the hack.  What I want to do is 
to
> define the collection of project folders outside of the subant block, 
and
> then use that collection with subant.  See my current hack below.

IIRC you can use a filelist to enforce ordering.

Re: using subant with multiple projects with specific build order

Posted by videophool <na...@beloved5.com>.
Here is the solution:
 
 
 
&lt;project name="master"&gt;
  
      &lt;filelist id="projects" dir="."&gt;
        &lt;file name="./EncodingUtils/build.xml"/&gt;
        &lt;file name="./DRMLibrary/build.xml"/&gt;
        &lt;file name="./MediaLibrary/build.xml"/&gt;
        &lt;file name="./Mp4Library/build.xml"/&gt;
        &lt;file name="./Mp2Library/build.xml"/&gt;
        &lt;file name="./AsfLibrary/build.xml"/&gt;
        &lt;file name="./MetaToolsLibrary/build.xml"/&gt;
        &lt;file name="./M2TSTools/build.xml"/&gt;
        &lt;file name="./AsfTools/build.xml"/&gt;
        &lt;file name="./Mp4Tools/build.xml"/&gt;
        &lt;file name="./TimedTextTools/build.xml"/&gt;
      &lt;/filelist&gt;

  &lt;target name="dev-all"&gt;
    &lt;subant&gt;
      &lt;target name="build"/&gt;
      &lt;target name="devel-pub"/&gt;
      &lt;filelist refid="projects" /&gt;
    &lt;/subant&gt;

  &lt;/target&gt;

&lt;/project&gt;



-- 
View this message in context: http://old.nabble.com/using-subant-with-multiple-projects-with-specific-build-order-tp28771184p28773086.html
Sent from the Ant - Dev mailing list archive at Nabble.com.