ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: A (recusive?) property problem.
Date Sat, 29 Jun 2002 02:37:48 GMT
----- Original Message -----
From: "Diane Holt" <holtdl@yahoo.com>

> 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>

I much prefer the <propertycopy> task myself, but there is actually a
round-about way to do this with just core Ant:

<property name="X" value="Y" id="X.prop"/>
<property name="Y" value="Z" id="Y.prop"/>
<property name="selector" value="${X}"/>
<property name="A" refid="${selector}.prop"/>
<echo message="A = ${A}"/>

In this case, it would output:

     [echo] A = Z

This is pretty wacky and confusing stuff though, so stick with
<propertycopy>  :))

    Erik





--
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