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: Looping over lines in a file
Date Thu, 15 May 2003 23:43:42 GMT

Here's a target that loops through lines:

<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> 

The file, "./properties/server_deploys" contains a list of servers I
deploy to.  Looks like this:

QA1.mycompany.com
QA2.mycompany.com
QA2.mycompany.com
Staging.mycompany.com
Production.mycompany.com



-----Original Message-----
From: Mike Castle [mailto:dalgoda@ix.netcom.com] 
Sent: Thursday, May 15, 2003 12:41 PM
To: ant-user@jakarta.apache.org
Subject: Re: Looping over lines in a file


In article <20030514144500.66460.qmail@web20422.mail.yahoo.com>,
Matt Benson  <user@ant.apache.org> wrote:
>Also, foreach has a "delimiter" attribute.  Don't know
>whether this would have worked, but I can't see why it shouldn't.

Wasn't sure how to get the delimite to be EOL character, until I did
more playing around.  Found ${line.separator}, which does appear to work
as the delmiter.

Thanks for kick in the right direction.

mrc

-- 
     Mike Castle      dalgoda@ix.netcom.com
www.netcom.com/~dalgoda/
    We are all of us living in the shadow of Manhattan.  -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different");
-- gcc

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message