ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: A (recusive?) property problem.
Date Sat, 29 Jun 2002 01:53:08 GMT
--- Zhou Wu <zwu_ca@yahoo.com> wrote:
> I have a problem like this:
>    
> <property name="test1" value="test1" />
> <property name="a.${test1}" value="a.test1" />
> 
> I wonder how I can use the property in second line?
> 
> <property name="test2" value="this is ${a.${test1}}" />
> won't work.

To do this, you need the ant-contrib <propertycopy> task. See:
  http://marc.theaimsgroup.com/?l=ant-dev&m=102511219322882&w=2

You'd use like this:
  <target name="setTest2">
    <property name="test1" value="test1"/>
    <property name="a.${test1}" value="a.test1"/>
    <propertycopy name="test2.tmp" from="${a.test1}"/>
    <property name="test2" value="this is ${test2.tmp}"/>
    <echo>test2 = ${test2}</echo>
  </target>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message