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:[EMAIL PROTECTED]]
> Gesendet am: Donnerstag, 5. Dezember 2002 11:36
> An: Ant Users List
> Betreff: Re: For-loop in Ant
> 
> 
> ----- Original Message -----
> From: "Markus Dettori" <[EMAIL PROTECTED]>
> To: "Ant Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, December 05, 2002 9:48 AM
> Subject: Re: For-loop in Ant
> 
> 
> >
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to