ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Iterate over an enumerated property.
Date Fri, 05 Jul 2002 16:45:08 GMT
--- Ronald Wildenberg <> wrote:
> I would like to know if I can specify a wildcard in
> the todir attribute of the copy target.


> E.g.:
> <copy file="myFile.txt" todir="../*/newlocation"/>
> Is something like that possible? If not, is it possible
> to iterate over a set of properties, that each represent a
> directory?

If you're running 1.5 (for <dirset>), and you use the ant-contrib
<foreach> task:

  <taskdef resource="net/sf/antcontrib/"/>

  <dirset id="ds" dir="..">
    <include name="*/newlocation"/>

  <target name="copy">
    <pathconvert pathsep="," property="ds" refid="ds"/>
    <foreach list="${ds}" target="doCopy" param="newloc"/>

  <target name="doCopy">
    <copy file="myFile.txt" todir="${newloc}"/>

for info wrt the ant-contrib tasks.

Possible alternative: See if could be modified to accept a
nested <dirset> in place of 'todir' (much like <fileset> is allowed in
place of 'file').



Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message