I’m using ANT 1.7.0
I’d like to create a target that on call, will append text to a string (saved in property).
for example:
<property name="str.text" value="" />
<target name="append.to.property" >
<property name="temp.text" value="${str.text}${new.text}" />
<property name="str.text" value="${temp.text}" />
</target>
The problem is that I can’t overwrite the property value in one target and read the changed value in another target.
How do I append a string to a property in ant?
You can’t change value of property in Ant.
You may use Ant Contrib variable task (see http://ant-contrib.sourceforge.net/tasks/tasks/variable_task.html) which provide mutable properties.