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
ANT is not a programming language and I'm not a fan of ant-contrib, which I think attempts to retrofit this feature...
My recommendation is to embed a scripting language into your build. The advantage of javascript is that it won't require additional jars, but I think you'll discover the groovy ANT task is extremely powerful.
$ ant -Dtimes=3
loop:
dosomething:
[echo] hello world
dosomething:
[echo] hello world
dosomething:
[echo] hello world
def count = properties.times.toInteger()
(1..count).each {
ant.ant(target: "dosomething")
}
An extra "bootstrap" target could be added to install groovy jar dependency automatically