ant-user mailing list archives

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

Nope.

> 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/antcontrib.properties"/>

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

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

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

See:
  http://marc.theaimsgroup.com/?l=ant-user&m=102100484512833&w=2
for info wrt the ant-contrib tasks.

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

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.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