ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <ma...@sedonacorp.com>
Subject Re: [PATCH] PropertyCopy and Foreach (NEW OPTIONAL TASKS)
Date Tue, 25 Sep 2001 17:39:28 GMT
yes, i agree that the order of a fileset is not guaranteed,
but if you specify an explicit list, it should execute in the
order given.  IE, if you are deploying an application to 3 servers
you may have something like:

 <property name="deploy.servers" value="server1,server2,server3" />
 <foreach list="${deploy.servers}" delimiter="," target="deploy" />

It should be guaranteed that it executes the "deploy" target for
server1 then server2 then server3.

While the order is not necessarily critical in this case, there
are situations which it might be, and i won't go into them here
(where the result of a later iteration depends on a side effect
 of an earlier one)



On Tue, 2001-09-25 at 10:18, Stefan Bodewig wrote:
> On 25 Sep 2001, Matthew Inger <matti@sedonacorp.com> wrote:
> 
> > I think that not guaranteeing the order of
> > a foreach task is a very bad thing.
> 
> My advice comes from a discussion with Peter Vogel, Roger Vaughn and
> Jose Alberto Fernandez on this list - about three or four months ago.
> It seemed to fit nicely into Ant's declarative approach as it
> parallels SQL's select instead of Perl's foreach - and I still like it
> better that way 8-).  Anyway, it's just an advice.
> 
> Most "foreach" tasks I've seen so far iterate over a <fileset>, as Ant
> doesn't guarantee the order by which the files in the fileset will be
> returned (it is platform and probably even JVM dependent), any
> guarantee for the task would be quite weak.
> 
> Stefan
-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 


Mime
View raw message