【发布时间】:2012-02-09 13:46:30
【问题描述】:
我想在一个目标中更改 Ant 文件中的“变量”,然后在另一个目标中查看该更改。
<variable name="foo" value="hello" />
<target name="print-me">
<echo message="${foo}" />
<antcall target="change-me" />
<echo message="${foo}" />
</target>
<target name="change-me">
<variable name="foo" value="world" />
</target>
虽然我希望它打印: 'hello , world' ,但它会打印 'hello, hello'
【问题讨论】:
-
你忘记了variable task中的unset="true"
标签: ant ant-contrib