ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Including other antfiles
Date Thu, 10 Aug 2000 16:44:09 GMT


I am a new user of ant.  I have similar needs in my project. I tried to use
"file" property to override common variables between the "called ant task"
and the "calling ant task". In my small sample it worked.

 <target name="prereq">
  <echo message="prereq task for TRACE" />
     <ant dir="${basedir}\..\Trace\build">
       <property name="name" value="trace"/>
       <property name="srcdir" value="${basedir}\..\Trace\src"/>
       <property name="build.classes" value="${basedir}\..\Trace\lib"/>
       <property name="lib.dir" value="${basedir}\..\ITrace\lib"/>
      <property name="build.javadocs" value="${basedir}\..\Trace\doc"/>
           <property file="${TraceDir}\build\local"/>

This prereq target is called from  MYTRACE component which depends on the
TRACE component. I tried setting the common properties and also using
"file" which overrides. I am hoping this feature will be supported in
future. The local property file can also be used to override the values
from the calling task.

If this is not a correct procedure please let me know.



"Steve Sonntag" <> on 08/10/2000 09:02:51 AM

Please respond to

To:   <>
Subject:  RE: Including other antfiles

>>> 10-Aug-00 1:40:12 AM  >>>

> -----Original Message-----
> From: Dino  Valente []
>  Sent: Wednesday, August 09, 2000 7:22 PM
> To:
> Subject: Re: Including other  antfiles
> I was also disappointed on how Ant
> handles  property
> values (you can only set it once and can never override
>  them).

One side effect of this behavior is that all properties are  passed
to subordinate ant files when one uses the ant task.  This means
that it is a nice way to pass common properties to all subordinate
ant files, but it also means that if there are properties that must be
for each ant file that new names must be invented for the property in  each
subordinate ant file because the property set in the superior ant file
be overridden.


View raw message