2

是否可以从另一个 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" />

child/build.xml

<target name="echoproperties">
  <echoproperties destfile="${echoproperties.file}" />
</target>

但我想避免创建临时文件。

4

1 回答 1

1

我发现 Ant-Contrib 有antfetch任务,虽然它的功能不是很好(没有前缀,没有属性集)。

于 2013-08-16T10:35:08.673 回答