ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: Copying a static list of files
Date Fri, 25 Jun 2010 14:57:29 GMT

On Jun 25, 2010, at 9:48 AM, Stefan Bodewig wrote:

> On 2010-06-25, Patrick Martin wrote:
>
>> I tried that but then, copy (verbose="true") tells me something like:
>> [copy] //host/share/dir1/dir2/one file.txt omitted as
>> //host/share/dir1/dir2/one file.txt is up to date.
>
>> So it means copy actually tried to copy the files over  
>> themselves ? It
>> did not take its "todir" attribute into account ?
>
> Yes, actually this is the surprising behavior if you sources are
> absolute paths.  I forgot about that myself, sorry.  See my other post
> about using mappers to turn the paths into relative paths again.
>

Note that if your sources are relative paths to begin with, you have  
other options.  Most simply and backward-compatibly if the list is in  
a line-delimited file you can supply that file to <fileset>'s  
includesfile attribute.  If for the sake of argument your list was  
in, say, a property or read from a url, and you are simply too  
stubborn or resource-constrained to write the includesfile to the  
filesystem, you could use a combination of the <tokens>  
resourcecollection, antcontrib <for>, and the brand-spanking-new  
<augment> task to loop over the lines (or other recognizable tokens)  
of your list and add each as a separate include to your fileset.   
Ain't that slick?  ;P

-Matt

> 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