ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Reason" <matt.rea...@movielink.com>
Subject RE: Ant-Contrib foreach | parallel not working..
Date Thu, 15 May 2003 17:36:25 GMT

Thanks for the fast response, Seb.  Yes it is Ant-Contrib I'm using.

The documentation says the foreach supports parallel looping.  I took
your advice and looked at the ForEach.java (attached) and it appears to
support it too (I'm no java expert).  The problem is that it doesn't
work.  

So my question remains, has anyone had any success executing a target in
parallel with foreach?


-----Original Message-----
From: Sebastien Blanc [mailto:Sebastien.Blanc@alcatel.com] 
Sent: Wednesday, May 14, 2003 7:20 PM
To: Matt Reason
Subject: Re: Ant-Contrib foreach | parallel not working..


if this is ant-contrib, u can check the foreach.java file, it is not a
big one and deliverered with the distribution. dwled a while ago and
this was a synchronous loop. dunno about now, but check it out if this
is ant-contrib u're using. seb.

Matt Reason wrote:

> Hello,
>
> I have a target I'd like to call n times.  I've set up a foreach loop 
> and it works great.  The only issue is it wastes time because one 
> execution of the target can only happen at one time.  It'd be much 
> more efficient to run the target in parallel.
>
> The foreach task has a parallel option, but it seems to be ignoring 
> the fact that I set it to true.  Has anyone else experienced this or, 
> hopefully, worked around it?
>
> Below is a rough idea the build.  Basically, I have a file with a list

> of host names of severs I want to connect to and run a script on.  
> Since each server is it's own 'world', it doesn't matter if they are 
> all done at the same time or not.(other than efficiency).
>
> <target name="deployToServers"/>
>   <loadfile property="server_deploys" 
> srcFile="./properties/server_deploys"/>
>   <foreach
>     list="${cms_deploys}" \
>     delimiter="&#x0A;"
>     param="thisServer"
>     target="executeRemoteBuildScript"
>     inheritAll="true"
>     parallel="true"/>
> </target>
>
> <target name="executeRemoteBuildScript">
>   <echo message="*********** ${userid}@${thisServer} ***********"/>
>   <sshexec
>      host="${thisServer}"
>      username="${userid}"
>      password="${ftp_password}"
>      trust="yes"
>      timeout="800"
>      command=". .profile; cd bin; ant;"/>
> </target>
>
> PS, if I do get this to work, what does the output to the screen look 
> like?  I bet it get's a little crazy.
>
> Thanks in advance for any help,
>
> Matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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