You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Karthi Prabhakaran <an...@yahoo.com> on 2000/11/28 22:14:23 UTC
Master build file and Sub-projects
I have my Project structure like this :
ProjectRoot
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"/>
</target>
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 ?
Thanks
Karthi
I need a means of running
---------------------------------
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.