【发布时间】:2013-01-13 17:39:40
【问题描述】:
我有一个 Ant 构建文件,它在文件顶部导入以下内容:
<project name="..." ...>
<property file="build.properties"/>
...
在项目根目录中,我有两个属性文件:build.properties 和 special-config.properties。我正在定义一个需要从special-config.properties 中读取以下属性的目标:
always.ask=true
所以目标需要像这样某种东西(请记住,build.properties 早在该目标执行之前就已设置为属性文件):
<target name="exec-special-logic">
<!-- Somehow read special-config.properties#always.ask and set it to a local variable... -->
</target>
但我确信如何加载第二个属性文件并使其属性(例如always.ask)可供 Ant 使用。提前致谢。
【问题讨论】: