在Ant中的路径中转换../

Roa*_*ers 0 ant

我有一个Ant构建,其中包含以下行:

WORKSPACE.dir = ${basedir}/../

然后我有:

CORE_PROJECT.dir= ${WORKSPACE.dir}/UUI_Core

这意味着我最终得到这样的路径:

C:\dev\workspaces\RTC\UUI_Core_ANT/..//UUI_Core

几乎在所有情况下都可以正常工作,但我正在尝试构建一个要在构建中使用的类列表.目前我有这个代码:

<pathconvert 
    property="coreClasses" 
    pathsep=" " 
    dirsep="." 
    refid="coreSources">
    <map from="C:\dev\workspaces\RTC\UUI_Core\src\" to="" />
    <mapper>
        <chainedmapper>
            <globmapper from="*.mxml" to="*"/>
        </chainedmapper>
        <chainedmapper>
            <globmapper from="*.as" to="*"/>
        </chainedmapper>
    </mapper>
</pathconvert>
Run Code Online (Sandbox Code Playgroud)

删除文件位置和jsut离开包结构的工作.但它不是很灵活.我应该可以在这里使用CORE_PROJECT.dir.

那么,我该怎么转换呢

C:\dev\workspaces\RTC\UUI_Core_ANT/..//UUI_Core

C:\dev\workspaces\RTC\UUI_Core

Ale*_*yak 7

WORKSPACE.dir = ${basedir}/../
Run Code Online (Sandbox Code Playgroud)

这不是有效的Ant语法.

要转换..你应该使用任务的location属性<property>而不是value.location用绝对路径替换属性值.在你的情况下:

<property name="WORKSPACE.dir" location="${basedir}/.."/>
Run Code Online (Sandbox Code Playgroud)

编辑:我应该添加,在设置类似路径的属性时始终使用location属性.