Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<target name="do-loop" description="Loop through list and call target">
	<!-- kicking it oldskool by creating your own iteratator -->
	<var name="op1" value="0" />
	<var name="op" value="+" />
	<var name="op2" value="1" />
	<var name="result" value="0" />

	<for list="${file-content}" param="list.key" delimiter=",">
		<sequential>
			<math result="result" operand1="${result}" operation="${op}" operand2="${op2}" datatype="int" />
			<var name="encryp" value="@{list.key}" />
			<antcall target="target-per-iteration" />
		</sequential>
	</for>
</target>

<target name="target-per-iteration">
	<property name="number.result" value="${result}" />
	<property name="list.result" value="${list}" />
	<echo message="Number: ${result} Key: ${list.result}" />
</target>