DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3341>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3341
ant replace function strips "$" chars within "value" strings
------- Additional Comments From umagesh@rediffmail.com 2001-09-21 21:10 -------
Ant is behaving consistently. This is the build.xml file that you have given
which I have modified so that the value (or replacement) string begins with $
<project name="abug" default="all" basedir=".">
<target name="all">
<replace dir="." includes="abug">
<replacefilter token="blah123" value="$blah123:blah456"/>
</replace>
</target>
</project>
Here is my original abug file:
these all fail...
junk=blah123
$blah123
hello=$blah123
blah123
And here is the abug file after the ant run:
these all fail...
junk=blah123:blah456
$blah123:blah456
hello=$blah123:blah456
blah123:blah456
Ant ignores the $ sign unless you escape it with a double $ ($$) sign. So, all
blah123 tokens become blah123:blah456
Here is another build.xml which has a $ sign in the replace token.
<project name="abug" default="all" basedir=".">
<target name="all">
<replace dir="." includes="abug">
<replacefilter token="$blah123" value="blah123:blah456"/>
</replace>
</target>
</project>
and here is the resulting abug file:
these all fail...
junk=blah123:blah456
$blah123:blah456
hello=$blah123:blah456
blah123:blah456
Here too, the $ sign in the token is ignored and all blah123 tokens are
substituted with blah123:blah456 values.
Whatever $ signs you see in the resultant abug file were the ones that were
there in the original file itself.
So I don't see where ant is failing to be consistent.
If this doesn't clear it up, please post the build.xml file where it fails to
be consistent.
Please note that I have tested this against Ant 1.4. If you get different
results with Ant 1.3, please upgrade to Ant 1.4.
Thanks,
Magesh
|