Ant脚本导入压倒一切的主路径ID名称 [英] Ant script import overriding main path id name
问题描述
说我有以下Ant脚本:
Say I have the following Ant script:
<project name = "imported">
<path id="same.classpath>
<pathelement location="c:\temp\imported"/>
</path>
<target name="imported.echo">
<echo>hell from import</echo>
</target>
</project>
这将被导入到这一个:
<project name = "importer">
<path id="same.classpath>
<pathelement location="c:\temp\importer"/>
</path>
<import file="imported.xml" as="i" />
<target name="importer.echo" depends="i.imported.echo">
<echo>hell from import</echo>
</target>
</project>
当我运行第二个脚本,它好像在importer.xml same.classpath引用的路径不被使用。相反,采用进口引用的一(C:\\ TEMP \\进口)正在使用。如果我分配唯一的名称为路径标识,我没有碰到这个问题,因此猜测。
When I run the second script, it seems as if the path referenced by same.classpath in importer.xml is not used. Instead the one referenced by imported (c:\temp\imported) is being used. If I assign unique names for the path id, I do not run into this problem, hence the guess.
从我的文学的理解,从主文件采取precedence属性。但是,这不是我所观察。我错过了什么?
From my understanding of the literature, properties from the main file take precedence. But this is not what I am observing. Did I miss something?
推荐答案
在这种情况下,什么东西被改写为的不的属性,但一个的参考 ID。与属性不同的裁判 - 什么参考ID相关联 - 可以构建,这是你看到什么时改变
In this case what's being overwritten is not a property but a reference id. Unlike properties the referee - what the reference id is associated with - can be changed during a build, which is what you observe.
这篇关于Ant脚本导入压倒一切的主路径ID名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!