ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <>
Subject Re: Implementing a loop in ANT
Date Wed, 07 Jun 2006 18:25:12 GMT
Ant-Contrib's <for> accepts any type which exposes an iterator()
method I believe, so you'd have to write a Java task or <scriptdef> to
create such an <integer-range> type.

You could also try a recursive <macro> or <antcall> (with proper
stopping condition ;-) that writes the numbers to a file, and then
<loadfile> it.

Using a little <script> to generate the series in a property would
probably be easier though. --DD

On 6/7/06, Guru Balse <> wrote:
> I am sure this question has been asked before, and I could not see any
> reasonable answer in the archives.  How can I implement a loop in ANT
> without using scripts?  For example, if I want to call a certain target
> N times, how can I do it?
> Using ant-contrib is OK.  Of course, something like <for
> list="1,2,3,4,5,6,...,N"> would work but I want N to be a property that
> can be specified in the command line.
> Thanks in advance for your suggestions.
>  - Guru Balse
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message