can';t使用嵌套引用元素用ant任务覆盖引用
我有一个带有路径声明的主构建文件can';t使用嵌套引用元素用ant任务覆盖引用,ant,Ant,我有一个带有路径声明的主构建文件 <path id="path.app.src"> <pathelement location="myfolder/src"/> </path> 然后我用 在subbuild.xml中,我有: <path id="subpath.app.src"> <pathelement location=".. some locations .."/> <path refid="path.
<path id="path.app.src">
<pathelement location="myfolder/src"/>
</path>
然后我用
在subbuild.xml中,我有:
<path id="subpath.app.src">
<pathelement location=".. some locations .."/>
<path refid="path.app.src" />
</path>
根据我的理解,使用嵌套调用
应该覆盖subbuild.xml中的path.app.src
但是我得到一个错误,比如:subbuild.xml:xx:Reference path.app.src找不到
我做错什么了吗?这是蚂蚁身上的虫子吗
我使用的是2006年12月13日编译的ApacheAnt版本1.7.0
谢谢,
莱昂内尔事实上,它现在的行为似乎是对的,但我无法解释我第一次做错了什么 以下是代码示例: build.xml
<?xml version="1.0"?>
<project name="test" default="build" basedir=".">
<path id="mainpath">
<pathelement location="my/main/path"/>
</path>
<target name="build">
<ant antfile="subbuild.xml" target="test">
<reference refid="mainpath" torefid="globalpathid"/>
<reference refid="mainpath" torefid="localtotargetpathid"/>
</ant>
</target>
</project>
我们可以看到,globalpathid
已经被覆盖,但没有localtotargetpathid
,这是规范中提到的behvior
我仍然无法解释第一条信息…事实上,它现在似乎有正确的行为,但我无法解释我第一次做错了什么 以下是代码示例: build.xml
<?xml version="1.0"?>
<project name="test" default="build" basedir=".">
<path id="mainpath">
<pathelement location="my/main/path"/>
</path>
<target name="build">
<ant antfile="subbuild.xml" target="test">
<reference refid="mainpath" torefid="globalpathid"/>
<reference refid="mainpath" torefid="localtotargetpathid"/>
</ant>
</target>
</project>
我们可以看到,globalpathid
已经被覆盖,但没有localtotargetpathid
,这是规范中提到的behvior
我仍然无法解释第一条消息…我认为您在refid path.app.src的子构建文件中有一个不完整的声明
<path id="subpath.app.src">
<pathelement location=".. some locations .."/>
<path refid="path.app.src" /> <=======
</path>
我认为您在refid path.app.src的子构建文件中有一个不完整的声明
<path id="subpath.app.src">
<pathelement location=".. some locations .."/>
<path refid="path.app.src" /> <=======
</path>
我指的是第一条消息:[ant]父项目不包含任何引用“mainpath”。我指的是第一条消息:[ant]父项目不包含任何引用“mainpath”
<path id="subpath.app.src">
<pathelement location=".. some locations .."/>
<path refid="path.app.src" /> <=======
</path>