If a property foo is defined, the string
${foo}
is replaced by the value of foo inside an ant
build script.
How can I pass the string literally, without
substitution, to an ant task? Example:
I want to replace all occurences of the string
${abc}
by
${xyz}
in a file. Using
<replace file="..." token="${abc}" value="${xyz}" />
does not work, because the property values of abc and
xyz are substituted, before replace is executed.
I need a way to *escape* the property substitution
mechanism of Ant.
Ronald
Ronald Fischer - 27 Nov 2003 09:01 GMT
> If a property foo is defined, the string
>
[quoted text clipped - 5 lines]
> How can I pass the string literally, without
> substitution, to an ant task?
This can be done by using two $ signs in succession:
$${foo}
Stefan Bodewig - 27 Nov 2003 09:13 GMT
> How can I pass the string literally, without
> substitution, to an ant task?
Double the $ sign. I.e. use $${foo} and it turns into ${foo} literally.
Stefan