ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dino Valente <d...@3dstockcharts.com>
Subject Re: local properties
Date Thu, 26 Oct 2000 16:06:54 GMT
I don't know the idea of local properties is being addressed but the Ant 
developers are well aware of this problem (or feature?). The persistence of 
property value is a problem when doing subbuilds as you have described.

The way I got around this problem is to have two files: the build.xml and 
buildRules.xml. The buildRules file contains your normal build routines. 
The build.xml file uses the ant task and you set the necessary properties 
there and invoke the subbuild target:

   <target name="package" depends="common">
     <ant antfile="buildRules.xml">
         <property name="name" value="MyApp"/>
         <property name="debug" value="on"/>
     </ant>
   </target>

The property values will override any values in the buildRules file and 
will be persistant for this file only. The biggest disadvantage with this 
approach is that you have to wrap all calls in the main build so it is 
propagated to the subbuild file (e.g clean, javadoc targets...).

Is there a better way?

dino

At 10:28 AM 10/26/00 -0400, you wrote:
>I've just been moving a number of projects into the ant (1.2) world.
>
>My preferred way of working with these projects is to have one build.xml 
>file with a target for each sub-project with each target executing the 
>build.xml file within that subprojects directory.
>
>Each build.xml file is relatively simple (most of them are almost 
>identical) and the main build.xml file is relatively easy to maintain.
>
>However, it does require some care with use of properties. Some form of 
>local property would help.
>
>Mike Douglass           douglm@rpi.edu
>Senior Systems Programmer
>Server Support Services 518 276 6780(voice) 2809 (fax)
>Rensselaer Polytechnic Institute 110 8th Street, Troy, NY 12180


Mime
View raw message