我遇到一个问题,包括来自父目录的Ant构建脚本。因为我需要为第三方软件开发自定义组件,所以我的项目目录结构设置如下:
/repos/HG REPO/Component // repo for my component
/repos/GIT REPO/contrib/contrib-build.xml // 3rd party software repo & build script
/repos/GIT REPO/contrib/[symlink to Component]/build.xml // My components build script
现在我需要从build.xml导入contrib-build.xml,所以在build.xml中我会使用:
<import file="../contrib-build.xml"/>
但是,这会在尝试从
中查找文件时导致错误/repos/HG REPO/contrib-build.xml
如何在不给出导入文件参数的绝对路径的情况下访问文件?如果我采用该路径,则必须手动记住将其设置在另一个开发设置上。
答案 0 :(得分:1)
<import file="../../GIT REPO/contrib/contrib-build.xml"/>
答案 1 :(得分:0)
错误是文件夹命名。 Ant不允许在目录名称中使用空格。 尝试改变
/repos/HG_REPO/contrib.build.xml
而不是
/repos/HG REPO/contrib.build.xml