antfilepathfdt

Ant produces jsfl with backslashes instead of slashes


I'm using Ant with FDT 3 and I have Ant creating a jsfl to compile fla's. When I use the built in '${basedir}' property in Ant it gives me the path with backslashes(\) in it because I'm on Windows. The problem is that when its run through jsfl the slashes are taken as escapes. I need to know how to modify the basedir property so the slashes are converted to forward slashes. I've tried splitting the basedir on backslashes in jsfl and joining it with forward slashes as a delimiter, but the backslashes still cause problems.

So what I need to know is how to change the basedir in Ant to have forward slashes?


Solution

  • You should be able to do it using the Ant pathconvert task.

    Here's a rough example:

    <path id="basedir.path">
        <pathelement path="${basedir}" />
    </path>
    <pathconvert targetos="unix" property="basedir.unix" refid="basedir.path"/>
    <echo message="${basedir.unix}" />
    

    Then you can use ${basedir.unix} in place of ${basedir}.