I'm trying to use the Ant task <loadfile>
in a loop to parse the contents of a file. I have something like
<loadfile srcFile="@{some.input}" property="my.property">
Since Ant properties are immutable, this doesn't work for me. I need 'my.property' to update on every iteration. Is there a way to achieve this? I know Ant-contrib has a <var>
task but I'm not sure how to use <loadfile>
with it.
Any recommendations?
Thanks.
You could create a new property in your MacroDef for each srcFile:
You can then use
foo
again in<loadfile>
Ant contrib also has a var task that unsets.
Lucks: It is convention to accept one of the answers so people know the question is resolved. I recommend you accept Gilbert's since he post a correct answer first.
Did you try the script in ANT.
I just ended up using the
<unset>
task provided by Antelope http://antelope.tigris.org/One of the built-in tasks that are able to override the property value is
script
.Below is a script and the output that proves the property value changed.
Output: