ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: looping (RE: Foreach task)
Date Tue, 12 Jun 2001 07:19:16 GMT
At 12:16 PM 6/11/01 -0400, asr@ufl.edu wrote:
>
>=> On Mon, 11 Jun 2001 23:06:34 +1000, Peter Donald <donaldp@apache.org>
said:
>
>[...]
>
>> 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).
>
>
>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/>
></fileset>
>
><target t0>
>  <compile a big load of stuff/>
></target>
>
>
><target t1 depends="t0">
>
>  <frobtaglib>
>    <mytargetsref="tld-targets"/>
>
>    <!-- Frobtaglib identifies a set of source/target mappings inferred from
>	 the target fileset.  Let's say it makes .jar s -->
>
>  </frobtaglib>
>
></target>
>
><target t2 depends="t1">
>  <twiddletaglib/>
>   <mytargetsref="tld-targets"/>
>   <!--  And so on -->
>  </twiddletaglib>
>
></target>
>
>
>The critical difference is:
>
>(forall $Thing: T1,T2,T3)
>
>vs.
>
>(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' the
>goal in either idiom.  I welcome attempts at counterexamples. The
complexities
>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
>equivalent.
>
>...
>
>And one of them is ant-y.  The other one is anti-ant-y.

Sorry - you lost me ;) I think your thesis is that anything that;

If the work performing a set of operations on a set of data then you can
either  do it in one of two ways;
a. Repeat set of operations for each data item in set
or
b. Repeat each operation on a set of data

Is that correct? If so then I would agree *if* there was no
interdependecies by the output produced. In many hand-maintained build
systems the build file writer (whether it be make/ant/whatever) will
sometimes rely on sequence as a cheap "dependency" mechanism. 

ie I will rely on the fact that library foo is built while building library
baz. I do this because I ordered foo before baz. If I was using method (a)
then this trick would work but if I was using method (b) then this trick
would fail.

Ant has no "higher-order" dependency analysis built in. GNUMake has high
order dependencies to a degree (but you need to be fairly comfortable with
make to use them) however many build files still rely on human building
build files to order them correctly (or else use tools to automate ordering
like gump or various makefile generation tools).

So while (b) is good in theory, it may not be so good in practice ;)
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               |
*-----------------------------------------------------*


Mime
View raw message