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 Sat, 26 Jun 2010 11:49:58 GMT
Hello,

I thought that using fileset with the includesfile attribute would
still trigger a source directory scan, which is what I want to avoid
to begin with. Isn't that correct?

However, this <augment> task does sound very interesting to add <file
name="..."/> elements to the filelist (avoiding the "space in
filename" issue) or to add additional <name name="..."/> selectors in
a <restrict> resource collection in order to simulate include and
exclude patterns.
Would it also work to add elements in a <firstmatchmapper> as
suggested by Stefan ?

Thanks,

Patrick

On Fri, Jun 25, 2010 at 4:57 PM, Matt Benson <gudnabrsam@gmail.com> wrote:
>
> 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
>
>

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


Mime
View raw message