ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Bacon <jba...@magmic.com>
Subject Re: recursive expansion of property names
Date Thu, 24 Jun 2004 23:32:29 GMT
sorry, I copied the line from a macro and forgot to modify the @.

Your example (first one) doesn't load properties from a file nor import 
the environment variables.  Are they handled differently?

In example two, it should resolve as follows (if everything worked 
correctly):

${${_ant}${_dot}${_file}}
${ant${_dot}${_file}}
${ant.${_file}}
${ant.file}

ant print:
'ant.file(1)': ${ant.file}

because ${ant.file} is not defined.

if you added the definition:
   <property name="ant.file" value="ant.file" />

then it would resolve ${ant.file} and print:
'ant.file(1)': ant.file

--
Jeffrey Bacon
jbacon@magmic.com
Creative Developer
http://www.magmic.com


Wascally Wabbit wrote:
> A typo? I don't think normal property expansion recognizes
> the '@'; that token is reserved for use inside macros...no?
> 
> This works fine for me:
>   <property name="afN" value=".file"/>
>   <echo message="'ant.file(0)': ${ant${afN}}"/>
> 
> This does not work (the recursive code doesn't handle it):
>     <property name="_dot" value ="."/>
>     <property name="_ant" value="ant"/>
>     <property name="_file" value="file"/>
>     <echo message="'ant.file(1)': ${${_ant}${_dot}${_file}}"/>
> 
> At 06:34 PM 6/24/2004, you wrote:
> 
>> well that's better.  It resolves the ${basedir} now but won't resolve 
>> properties defined as so:
>>
>>   <property environment="env" />
>>   <property file="${basedir}/@{file}" />
>>
>> -- 
>> Jeffrey Bacon
>> jbacon@magmic.com
>> Creative Developer
>> http://www.magmic.com
>>
>> [[ snip ]]
> 
> 
> The Wabbit
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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


Mime
View raw message