ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Foreach task)
Date Mon, 11 Jun 2001 16:35:55 GMT
an interesting twist to this is the case where you want your build.xml 
to describe an environment where the fileset is an arbitrary number, 
which is not necessarily known at the time of buildfile authoring, or 
else has to be flexible.

For instance, using the FTP task to deploy the results of the build to 
all servers in a cluster...the build process itself doesn't change when 
you add another server to the cluster. In this case the for-each 
<fileset...> description is very elegant. Hard-coding for every case 
(unrolling the loop) is absurd, and masking the deployment action off 
with a custom tag actually DECREASES the level of description of the 
build itself.

How is the "right" way to handle a situation like this?
If it comes down to running a build by hand for each server, what's the 
big advantage in using Ant in the first place, over say a BAT file?


-----Original Message-----
From: asr []
Sent: Monday, June 11, 2001 11:17 AM
To: ant-user
Cc: asr
Subject: Re: looping (RE: Foreach task)

=> On Mon, 11 Jun 2001 23:06:34 +1000, Peter Donald 
<> said:


> However the usecase that ant needs is executing the same set of tasks 
> 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 
> all require same steps to generate compile and deploy etc).

OK, this feels to my ant-naive perceptions like a case of what I 
quoted.  I'll
spit out a straw man, and tell me where I'm missing your point?

<fileset name="tld-targets">
 <30 taglib names/>

<target t0>
  <compile a big load of stuff/>

<target t1 depends="t0">


    <!-- Frobtaglib identifies a set of source/target mappings inferred 
	 the target fileset.  Let's say it makes .jar s -->



<target t2 depends="t1">
   <!--  And so on -->


The critical difference is:

(forall $Thing: T1,T2,T3)


(forall $Thing: T1)
(forall $Thing: T2)
(forall $Thing: T3)

I assert that, for any real case of T1,T2,T3 it is possible to 'phrase' 
goal in either idiom.  I welcome attempts at counterexamples. The 
and pitfalls of the "transform sets of files" are different than those 
of the
"run scripts on individual files".  But I bet they are in fact provably


And one of them is ant-y.  The other one is anti-ant-y.

- Allen S. Rout

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message