ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: calling tasks per directory?
Date Thu, 12 Sep 2002 16:47:31 GMT
Since I was already working on it, here is a sample...
I used Erik's suggestion from earlier today about
directly making a path into a property without using
<pathconvert>, and just specified the current
path.separator to <foreach>:

<project name="iteratedirs" default="default"
basedir=".">

	<taskdef
resource="net/sf/antcontrib/antcontrib.properties"/>
	
	<property name="src.dir" value="src" />
	
	<target name="default">
	
		<path id="path">
			<dirset dir="${src.dir}" />
		</path>
		
		<property name="dirs" refid="path"/>

		<foreach list="${dirs}" target="-echo" param="dir"
delimiter="${path.separator}"/>
	
	</target>
	
	<target name="-echo">
		<echo message="Processing ${dir}" />
	</target>

</project>

-Matt

--- Matt Benson <gudnabrsam@yahoo.com> wrote:
> Yeah, that's what I was working on... :)
> 
> -Matt
> 
> --- Dominique Devienne <DDevienne@lgc.com> wrote:
> > You can create a <path> (which can contain a
> > <dirset>), and <pathconvert> it
> > to a property (comma separated, without spaces for
> > <foreach>), and use that
> > as the 'list' attribute of <foreach>. --DD
> > 
> > -----Original Message-----
> > From: M [mailto:martin.sillence@prnewswire.co.uk] 
> > Sent: Thursday, September 12, 2002 11:36 AM
> > To: Ant Users List
> > Subject: Re: calling tasks per directory?
> > 
> > Matt Benson wrote:
> > > 
> > > <foreach> is your friend!
> > > 
> > > That's what I think, anyway...
> > 
> > Do you have any examples that take dynamicly take
> a
> > directory tree using
> > Foreach?
> > It looks like Foreach just takes a static list but
> > I'm probably missing
> > the obvious.
> > 
> > -- 
> > Regards,
> > M
> > 
> > Martin Sillence
> > PR Newswire
> > 
> > DL +44 (0)1865 78 5065
> > F  +44 (0)1865 78 5100
> > W  www.prnewswire.eu.com
> > ---------------------------------------
> > Any views or opinions are solely those of the
> author
> > and do not
> > necessarily represent those of PR Newswire Europe.
> > The e-mail
> > contents are intended only for addressee and may
> > contain
> > confidential and/or privileged material. If you
> are
> > not the
> > intended recipient, please do not read, copy, use
> or
> > disclose
> > this communication and notify the sender.
> > 
> > --
> > To unsubscribe, e-mail:  
> > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:ant-user-help@jakarta.apache.org>
> > 
> > --
> > To unsubscribe, e-mail:  
> > <mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:ant-user-help@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

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


Mime
View raw message