can we write a build file with a for loop that runs n times ?
For eg., i want to run a for loop for n no of time depends on the value of n. But i dont want to write in java and call in build file...i am just trying with ANT tasks itself todo this... if anyone gives me a hint, or know abt how to write, kindly help me...
Ant doesn't directly support this. It very deliberately doesn't have scripting-like constructs becasue it is not a scripting language. However, you can get the ant-contrib extensions which include this sort of stuff.
Or you could write your own AntTask that reads a property from the build file, and iterates accordingly. It's not that hard.
Joined: Jul 29, 2008
Thanks Paul and Ulf !! you have given me a hint...
Using ANT Contrib tasks , i just wrote the simple loop
This code results in, printing the values one by one. But the size is fized and i need to give all the inputs in the list attribute...Is there any way that i can specify the list = No of values (n) and iterate it by the loop ( i= i+1). I tried several possibilities, but i cud not get it. Can anyone help me ?