You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2004/08/04 07:02:49 UTC
DO NOT REPLY [Bug 30456] New: -
replaceregexp fails to insert '/' characters
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30456>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30456
replaceregexp fails to insert '/' characters
Summary: replaceregexp fails to insert '/' characters
Product: Ant
Version: 1.6.2
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Minor
Priority: Other
Component: Optional Tasks
AssignedTo: dev@ant.apache.org
ReportedBy: dbd@smart.net
When using ${basedir} in replacement, appropriate '/' characters are not
inserted. Example:
<project ... basedir=".." ...>
<target name="copy">
<copy todir="${basedir}/src/to" file="${basedir}/src/from/testfile.xml"
overwrite-"yes"
/>
</target>
<target name="edit" depends="copy">
<replaceregexp pattern="C:/original/pattern" replace="${basedir}/x/y/z">
<fileset file="${basedir}/src/to/testfile.xml"/>
</replaceregexp>
</target>
</project>
If this is run from directory 'C:\projects\TestBug\src\from', the value of
${basedir} should be "C:/projects/TestBug/src", and the replacement should read:
"C:/projects/TestBug/src/x/y/z". Instead, the replacement does
read: "C:projectsTestBugsrc/x/y/z".
Circumvention: Annoying and inelegant, but any property which is fully defined
will work ok instead of ${basedir}. Note that defining basedir explicitly on
the project definition also does not work.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org