Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant produces jsfl with backslashes instead of slashes

Tags:

ant

filepath

fdt

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?

like image 224
Jordan Avatar asked Nov 25 '09 20:11

Jordan


1 Answers

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}.

like image 78
martin clayton Avatar answered Jan 03 '23 18:01

martin clayton