ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wascally Wabbit <wascallywab...@earthling.net>
Subject Re: [antxtras] Cannot echo variable
Date Mon, 03 Jan 2011 16:16:05 GMT
Hi Peter,

Not sure why your original snippet did not work; it should.
You're declaring a variable -- so you should use $var:
not $ref: (variables and references are distinct).

To define a string as a reference, use the scope='project'
attribute of the <assign/> component as in:

   <oja:assign var="arefid" value="Hello" scope="project"/>
   <echo message="MYID: ${$ref:myrefid}"/>

I've attached an example snippet file that shows both uses
(run it from $ANTXTRAS_HOME/etc using 'ant -f assign-example.xml')

HTH,
The Wabbit


P.N. wrote:
> Found my problem: had to use $ref: instead of $var:
> 
> Regards
> P.
> 
> 
> P.N. schrieb:
>>
>> Hello!
>>
>> I've got a problem with variables in the following snippet:
>>
>> <xtras:assign var="test" value="dummy"/>
>> <echo message="TEST = ${$var:test}"/>
>>
>> Results in:
>>
>> [echo] TEST = ${$var:test}
>>
>> Seems, the reference to the variable is incorrect.
>> Using antxtras_3.0.0b1-build1083.45 and ant-1.8.1.
>>
>> What's wrong???
>>
>> Kind regards
>>
>> Peter
> 
[snip]

Mime
View raw message