Ant 生成带有反斜杠而不是斜杠的 jsfl [英] Ant produces jsfl with backslashes instead of slashes

查看:49
本文介绍了Ant 生成带有反斜杠而不是斜杠的 jsfl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 FDT 3 中使用 Ant,并且我让 Ant 创建了一个 jsfl 来编译 fla.当我在 Ant 中使用内置的 '${basedir}' 属性时,它为我提供了带有反斜杠 (\) 的路径,因为我在 Windows 上.问题是,当它通过 jsfl 运行时,斜杠被视为转义符.我需要知道如何修改 basedir 属性,以便将斜杠转换为正斜杠.我试过在 jsfl 中用反斜杠分割 basedir 并用正斜杠作为分隔符加入它,但反斜杠仍然会导致问题.

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.

那么我需要知道的是如何将 Ant 中的 basedir 更改为具有正斜杠?

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

推荐答案

你应该可以使用 Ant pathconvert 任务.

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

这是一个粗略的例子:

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

然后您可以使用 ${basedir.unix} 代替 ${basedir}.

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

这篇关于Ant 生成带有反斜杠而不是斜杠的 jsfl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆