Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从不同的ant项目获取属性_Ant - Fatal编程技术网

从不同的ant项目获取属性

从不同的ant项目获取属性,ant,Ant,是否可以从另一个ant项目中读取属性 我可以用: <ant antfile="child/build.xml" target="echoproperties"> <property name="echoproperties.file" value="${tmp}/child.properties" /> </ant> <property prefix="child" file="${tmp}/child.properties" /> <d

是否可以从另一个ant项目中读取属性

我可以用:

<ant antfile="child/build.xml" target="echoproperties">
  <property name="echoproperties.file" value="${tmp}/child.properties" />
</ant>
<property prefix="child" file="${tmp}/child.properties" />
<delete file="${tmp}/child.properties" />

但是我希望避免创建临时文件。

我发现Ant Contrib有task,尽管它的功能不是很好(没有前缀,没有propertysets)。

Ant任务上有一个“inheritAll”属性,它传递父构建的属性。其他选项是一个或多个“属性”标记,如上面的示例所示。您误解了-我需要从另一个项目(从子项目到父项目)中获取属性,而不是共享它。
<target name="echoproperties">
  <echoproperties destfile="${echoproperties.file}" />
</target>