Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
311 views
in Technique[技术] by (71.8m points)

filepath - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...