ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: For-loop in Ant
Date Thu, 05 Dec 2002 11:02:25 GMT
1. The doing target in parallel
<target name="do">
    <parallel>
         <doSomething/>
    </parallel>
</target>
<target>
    <foreach target="do"/>
</target>

I think this would NOT work. The foreach will wait for do-target.


2. The foreach in parallel
<target name="do"/>
<target>
    <parallel>
         <foreach target="do"/>
    </parallel>
</target>

This don´t work either. Only one instruction in the parallel-Task.


3. Modify existing code .... 
The hard solution: write your own foreach-Task. For example by extending the
Ant-Contrib-Foreach and forking a new thread before calling the do-target.
I did a view into the sources
(http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant-contrib/src/
net/sf/antcontrib/logic/ForEach.java?rev=1.4&content-type=text/vnd.viewcvs-m
arkup). For each entry a CallTarget is instantiated and executed.
If you do this via threading it could work (maybe).


Jan Matèrne

> -----Ursprüngliche Nachricht-----
> Von: Markus Dettori [mailto:markus.dettori@wuerth-phoenix.com]
> Gesendet am: Donnerstag, 5. Dezember 2002 11:36
> An: Ant Users List
> Betreff: Re: For-loop in Ant
> 
> 
> ----- Original Message -----
> From: "Markus Dettori" <markus.dettori@wuerth-phoenix.com>
> To: "Ant Users List" <ant-user@jakarta.apache.org>
> Sent: Thursday, December 05, 2002 9:48 AM
> Subject: Re: For-loop in Ant
> 
> 
> >
> > ----- Original Message -----
> > From: <Jan.Materne@rzf.fin-nrw.de>
> > To: <ant-user@jakarta.apache.org>
> > Sent: Thursday, December 05, 2002 9:19 AM
> > Subject: AW: For-loop in Ant
> >
> >
> > Well, I think that should match somehow!
> > Thanks
> >
> 
> Hi again,
> 
> just works fine, BUT, how can I manage it that the targets called by
> <foreach>
> will be started in parallel ?
> Now it will be like that:
> call target with 1, finished1, call target with 2,finished 2 ......
> But I want something like that:
> call target with 1, call target with 2, call target with 3, 
> finished 2,
> finished 1, ........
> Putting the called target tasks in <parallel> has no sense.
> I don't want to wait for the called task to finish.
> 
> 
> thanks for hints,
> Markus
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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