使用带有空格的路径设置Ant文件

时间:2012-05-22 20:02:15

标签: macos shell unix ant

我正在使用包含空格的源路径让别人的ant构建工作。其中大部分都是基本的shell脚本,在路径周围添加双引号,但这个让我感到难过:

(来自build.xml):

<path id="headers">
    <fileset dir="${source.main.dir}">
        <include name="**/*.h"/>
    </fileset>
</path>

source.main.dir是一个包含空格的路径。它位于模式找到的每个包含文件名的前面。如何在每个引号附近引用这个?

如果重要,我在OS X Lion 10.7.4上从命令行运行构建。

1 个答案:

答案 0 :(得分:1)

我想我明白了!我改变了:

    <pathconvert pathsep=" " property="doc.files.list" refid="headers" />

    <pathconvert pathsep=" " property="doc.files.list" refid="headers">
        <map from='${source.main.dir}' to='"${source.main.dir}"' />
    </pathconvert>

它似乎现在正在运作。