Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#8 Repeat task

open
nobody
None
5
2004-09-10
2004-09-10
Alex Hildyard
No

The <repeat> task repeats a block of tasks either while
a specified condition holds true, or until a specified
condition becomes true.

It provides a generic way of looping where the
<foreach> task is inapplicable; more importantly, it loops
on a condition rather than a collection, thus allowing for
early exit.

Finally, since <repeat> is a self-contained task, it side-
steps the re-entrancy problems of the <call> task.
Specifically, one or more <repeat> loops can now be
defined within a single target, rather than requiring a
separate target for the body of each loop, with looping
variables initialised outwith the target containing the
loop body.

Discussion

  • Alex Hildyard
    Alex Hildyard
    2004-09-10

    Unified Diff (for .csproj) + repeat.cs task

     
    Attachments