ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karthi Prabhakaran <>
Subject Master build file and Sub-projects
Date Tue, 28 Nov 2000 21:14:23 GMT

I have my Project structure like this :


    L Sub-Project1

    L Sub-Project2

    L etc.


The "ProjectRoot" directory has a build.xml (call it the Master build file) with a set of
targets and each of the Sub-Projects have a "<Sub-Projectn>.xml" which will have a subset
of targets that are in <ProjectRoot>/build.xml.

Currently, the way I build each Sub-Project is by using a CURRENT_SUB_PROJECT variable (set
in a property file) and then doing a :

 <target name="build_sources" description=" - Will build your sources and create the library
(.JAR/.DLL/.so etc..)">
   <ant antfile="${CURRENT_SUB_PROJECT}.xml" dir="${CURRENT_SUB_PROJECT}" target="build_sources"/>

The above line will be in the Master build file (build.xml) in the ProjectRoot directory.
 Assuming that CURRENT_SUB_PROJECT=Sub-Project1 in the property file that is read by build.xml,
this will invoke ant on Sub-Project1.xml in that directory with the target "build_source".

This involves editing the property file and changing the CURRENT_SUB_PROJECT for every sub-project
to be built. 

I dont want to do this edit and build step.  Instead, I want to run through each of the Sub-Project<n>
(whichever ones are present) directories and then invoke a particular target on them from
the master build.xml.

Can somebody suggest any ideas ?







I need a means of running 

Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
View raw message