【发布时间】:2014-06-14 01:05:48
【问题描述】:
目前在eclipse中,我们直接通过右键单击它们来执行ant脚本运行为> ant Build。我们也有一个构建属性。但是随着我们项目的复杂性的增长,有没有一种方法可以使用不同的适当文件,如 Buildfile_test.properties 、 buildfile_QA.properties 并在从 Eclipse 中运行 ant 时传递名称,而无需每次修改 build.xml?
【问题讨论】:
目前在eclipse中,我们直接通过右键单击它们来执行ant脚本运行为> ant Build。我们也有一个构建属性。但是随着我们项目的复杂性的增长,有没有一种方法可以使用不同的适当文件,如 Buildfile_test.properties 、 buildfile_QA.properties 并在从 Eclipse 中运行 ant 时传递名称,而无需每次修改 build.xml?
【问题讨论】:
您可以在 Run > External Tools > External Tools Configuration 的“参数”部分中为您的 Ant 构建定义一个带有属性文件名的参数。比如:
-Dproperties=Buildfile_test.properties
您可以像这样在 build.xml 中使用它:
<property file="${properties}"/>
【讨论】: