从不同的ant项目获取属性
是否可以从另一个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 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>