ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Copying a static list of files
Date Fri, 25 Jun 2010 14:36:44 GMT
On 2010-06-25, Patrick Martin wrote:

> I still don't get how <copy> will know which basedir to take from the
> source files in order to recreate the correct folder structure in the
> "todir" folder.
> Let's say that my file list contains the full path:

> //host/share/dir1/dir2/one file.txt
> //host/share/dir1/dir2/two files.txt
> //host/share/dir1/three files.txt

> I loaded that in my property.
> Then:
> <copy todir="${target.dir}">
>  <resourcelist>
>    <propertyresource name="property-holding-list-of-files"/>
>  </resourcelist>
> </copy>

> How will copy know it should take files in //host/share/dir1 or in
> //host/share  for example?

I see.  Throw in a <mapper> to strip the prefix again.

<copy todir="${target.dir}">
   <propertyresource name="property-holding-list-of-files"/>
 <globmapper from="//host/share/dir1/*" to="*"/>

If there are different roots you want to copy from, you could use a
<firstmatchmapper> to wrap the alternatives.


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

View raw message