ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: property expansion: expected behaviour?
Date Wed, 24 Apr 2002 14:28:36 GMT
This is the expected behavior in Ant 1.4.1.... a single $ gets stripped.
Two $$ gets replaced by a single $.

Ant 1.5 changes this behavior such that single $ remain - all other behavior
remains the same so that $$ -> $.



----- Original Message -----
From: "stephan beal" <stephan@wanderinghorse.net>
To: <ant-dev@jakarta.apache.org>
Sent: Wednesday, April 24, 2002 10:12 AM
Subject: property expansion: expected behaviour?


> Ant 1.4.1, i'm calling ProjectHelper.replaceProperties(...) on a string
like
> the following:
>
> $foo = ${build.top.dir};
> print "$foo\n";
>
> The property expansion works fine, but it also strips the $ from '$foo',
so i
> end up with:
>
> foo = "/some/path;
> print "foo\n";
>
> i'm attaching a small class which tests the xml code below, showing the
> behaviour:
>
> <taskdef name="propexpand"
> classname="net.sf.antcontrib.logic.PropExpansionTest"/>
>
> <property name="whattodrink" value="milk"/>
> <propexpand replaceproperties="true">
> $foo = "${whattodrink}";
> print "foo=$foo\n";
> </propexpand>
>
> <propexpand replaceproperties="false">
> $foo = "${whattodrink}";
> print "foo=$foo\n";
> </propexpand>
>
> It produces this output:
> property expansion = [true]
> text=
>         foo = "milk";
>         print "foo=foo\n";
>
> property expansion = [false]
> text=
>         $foo = "${whattodrink}";
>         print "foo=$foo\n";
>
>
> Note all the missing dollar signs in the first one.
>
> ----- stephan
> stephan@einsurance.de - http://www.einsurance.de
> Office: +49 (89)  552 92 862 Handy:  +49 (179) 211 97 67
> "I didn't give in to the Nazis and I won't give in to the bladder."
> - The Queen Mum
>


----------------------------------------------------------------------------
----


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


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


Mime
View raw message