I want to change “variable” in Ant file, in one target and see that change in another target.
<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>
While I want it to print: ‘hello , world’ , it prints ‘hello, hello’
Either use :
as Oers already mentioned in his comment to your question or use a more
straightforward approach with the
let taskof Ant addon Flaka :