Last active
December 18, 2015 17:49
-
-
Save hydra1983/5820910 to your computer and use it in GitHub Desktop.
Counter for iteration a list in for task based on math task of ant-contrib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<var name="counter" value="0"/> | |
<for list="{list}" param="{param}"> | |
<sequential> | |
<switch value="${counter}"> | |
<case value="0"> | |
<!-- do something --> | |
</case> | |
<case value="1"> | |
<!-- do something --> | |
</case> | |
<!-- other cases --> | |
</switch> | |
<!-- increase the counter --> | |
<math result="counter" | |
operand1="${counter}" | |
operation="+" | |
operand2="1" | |
datatype="int"/> | |
</sequential> | |
</for> | |
<var name="counter" unset="true"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment