ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schmitt <redknig...@gmx.net>
Subject Re: local properties
Date Mon, 30 Oct 2000 08:33:11 GMT
Hello

Does this mean that when I call build2.xml  from build.xml using the
<Ant> task
the properties of build2.xml will only exists during the execution time
of the
build2.xml file. I ask this because of I have to build files which uses
mostly
the same properties and I'm searching a method to compile them from a
superxml
file and your example shows  nice solution to me.

Yours
Stefan S


Dino Valente wrote:

> 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