Iterate over for loop with fixed amount of iterations
问题 I am using ant-contrib library in my ant scripts, but I do not get how can I make a fixed amount of loops using foreach tag? By fixed amount of iterations I do not mean some hardcoded value, but the ant property, supplied from command line. 回答1: The following code creates a loop with a fixed number of 5 iterations: <target name="example"> <foreach param="calleeparam" list="0,1,2,3,4" target="callee"/> </target> <target name="callee"> <echo message="${calleeparam}"/> </target> It prints