ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Lindwall <>
Subject filter: Windows backslashes in a properties file
Date Thu, 03 Apr 2003 03:55:40 GMT
My build.xml is copying a properties file and using a filterset to perform substitutions during
the copy.

    <copy file="${src.test.dir}/templates/" todir="${build.test.dir}"
        <filter token="LOR_HOME" value="${basedir}"/>

On our Windows development machines ${basedir} is generally "D:\Lor".   The resulting file
is properly substituted such that any occurrence of "@LOR_HOME@" is replaced with "D:\Lor".

The output file is a properties file and when we load the properties at runtime this string
is transformed to "D:Lor" -- note the missing backslash.  The resulting path is no good since
it lacks that initial backslash.

Is there some way to handle this issue nicely?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message