antology 2.0.7
Task

<forEach2>

An enhanced version of the <for> task of ant-contrib which supports <break> and <continue> subtasks.

It iterates over

and executes the configured <sequential> for each element. The behavior for the case that the Sequential fails is configured by the keepGoing attribute.

The dynamic attribute designated by param="..." reflects the value of the current element of the iteration.

Usage examples:


   <forEach2 list="a,b,c" param="s">
       <sequential>
           <echo message="@{s}" />
       </sequential>
   </forEach2>

   <forEach2 count=3 param="i">
       <sequential>
           <echo message="@{i}" />
       </sequential>
   </forEach2>
 

If the message="..." attribute is configured, the task reports the throughput of each iteration, and, if showEta="true", it computes and reports the estimated remaining time after each iteration. The messages that are logged before and after each element are the same as for the <throughput> task, however, the (previous|current|remaining)(Quantity|Duration) are not configured through properties, but reflect measured values:

previousQuantity The number of elements processed before the current element, or, for resource collections, the total of the sizes of the resources processed before the current resource
previousDuration The duration it took to process the elements before the current element
currentQuantity 1, or, for resource collections, the size of the current resource
currentDuration The duration it took to process the current element
antology 2.0.7

Copyright © 2019. All rights reserved.