ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venk...@us.ibm.com
Subject RE: Including other antfiles
Date Thu, 10 Aug 2000 16:44:09 GMT



Hi,

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"/>
     </ant>
  </target>

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.

Regards

venkataraman





"Steve Sonntag" <VTAG@novell.com> on 08/10/2000 09:02:51 AM

Please respond to ant-user@jakarta.apache.org

To:   <ant-user@jakarta.apache.org>
cc:
Subject:  RE: Including other antfiles






>>> kohler@cms.tecmath.de 10-Aug-00 1:40:12 AM  >>>
Hi,

> -----Original Message-----
> From: Dino  Valente [mailto:dino@3dstockcharts.com]
>  Sent: Wednesday, August 09, 2000 7:22 PM
> To:  ant-user@jakarta.apache.org
> Subject: Re: Including other  antfiles
[snip]
> 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
unique
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
cannot
be overridden.

-Steve




Mime
View raw message