properties file - How to use ant expandproperties with windows pathseparator -


I tried to use ants: It works for simple text properties, but I get weird results when the property has a window path.

  & lt; Property name = "myAntFile" value = "$ {ant.file}" /> & Lt; Loadproperties srcFile = "my.properties" & gt; & Lt; Filterchain & gt; & Lt; Detailed Properties & gt; & Lt; / Filterchain & gt; & Lt; / Loadproperties & gt; & Lt; Echo message = "$$ {external} = $ {external}" /> The  

property file looks like this:

  external = $ {myAntFile}  

is the result:

Buildfile: C: \ projects \ trunk \ build.xml ... [echo] $ {external} = c: projects \ trunkbuild.xml

me I know that there are backslashes and special whitespace characters for property files, although I do not see how I can translate buildscript properties in that particular sense.

Anyone can find out how to solve it or it is an ant bug (maybe there should be additional property to avoid the wide properties chain used in the property file references ?)?

In the form of a forward slash / path separator with an ant, Even on Windows: [code: C: /projects/trunk/build.xml]

If $ {ant.file} backslash , Before you convert this path before loading the properties file.

Unfortunately I have not yet found a definite way to change the path from C: \ a \ path to c: / a / path and back. It is believed that this can be a trick ...

   & Lt; / Pathconvert & gt;  

... but it confuses the relative and complete path and I could not work it while testing on my OS X machine.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -