Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 11496 invoked by uid 500); 11 Jun 2001 13:05:09 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 11303 invoked from network); 11 Jun 2001 13:04:29 -0000 Message-Id: <3.0.6.32.20010611230634.008bc100@mail.alphalink.com.au> X-Sender: gdonald@mail.alphalink.com.au X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Mon, 11 Jun 2001 23:06:34 +1000 To: ant-user@jakarta.apache.org From: Peter Donald Subject: Re: looping (RE: Foreach task) In-Reply-To: <200106111202.f5BC2N950356@smtp.ufl.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N At 08:02 AM 6/11/01 -0400, asr@ufl.edu wrote: >So: What is the essence of 'iteration' for the purpose of this debate? "iteration" for the purpose of this debate is something like . Some people try to confuse the definition to serve an agenda or because of hangups from other build systems (ie make). >I define a set of input files Si, a set of corresponding output files So, and >a process trans(Fi) by which an individual Fi may be transformed to Fo, and >let ant figure out where it's necessary. > >Is that iteration? nope - but good (GNU)make practices would implement this as iteration. >I define a set of input files Si, a function up-to-date(Fi) to tell if an >individual Fi has been processed, and a process trans(Fi) to do the right >thing (perhaps untar, jar, whatever) > >Is that iteration? nope - see above ;) Both of the above would be best implemented as tasks. In Ant1 it is a PITA to do as there is little core support for writing such things and keeping separate task libraries is also painful. In Ant2 we have decided to build a "framework" so that implementing a task to do above will be trivial. However the usecase that ant needs is executing the same set of tasks with different parameters. ie Repeat tasks t1 -> tn with different values for A, B and C properties. It is really useful when you need to repeate the set of operations over a large number of datasets (ie if you have 30 taglibs that all require same steps to generate compile and deploy etc). Essentially in this facility the foreach is acting as a generic target with a (possibly dynamically generated) list of input parameters. The reason people ask for this is essentially because ant is not designed to have generic rules. People have implemented them as hacks via antcall/ant/dtd includes/etc but in general this increases cost of maintaining project. Since everyone seems to be an "expert" on this subject, it is likely that no mechanism will be included in core. You will have to go to other places (ie proposed taskdefs.org or perhaps sourceforge) to pick it up. Cheers, Pete *-----------------------------------------------------* | "Faced with the choice between changing one's mind, | | and proving that there is no need to do so - almost | | everyone gets busy on the proof." | | - John Kenneth Galbraith | *-----------------------------------------------------*