ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Martin <antu...@gmail.com>
Subject Re: Copying a static list of files
Date Fri, 25 Jun 2010 14:21:21 GMT
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?

On Fri, Jun 25, 2010 at 4:08 PM, Stefan Bodewig <bodewig@apache.org> wrote:
> On 2010-06-25, Patrick Martin wrote:
>
>> This looks really promising! How do you use it with copy?
>
> <resourcelist> is a resource collection, you can use it everywhere where
> Ant supports them.
>
> <http://ant.apache.org/manual/Types/resources.html#resourcelist>
>
> In particular you can use it as a nested element of <copy> directly.
>
>> where is the equivalent of the "dir" attribute of <fileset> or
>> <filelist>?
>
> There is none.  Do you need one?
>
> If all your path's are relative to a common dir ${dir} and you have
> those relative path inside a file "myfiles.txt" you'd do something like
>
> <copy ...>
>  <resourcelist>
>    <file file="myfiles.txt"/>
>    <prefixlines prefix="${dir}/"/>
>  </resourcelist>
> </copy>
>
> to turn your relative paths into absolute paths.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message