You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by rc...@amig.com on 2002/06/12 19:06:38 UTC

FileSet and FileList limitations summary

I have been searching the archives for a solution to a common problem in my
ant scripts: the desire to parameterize an ant script through properties.

The fundamental limitation comes when trying to populate FileList-like or
FileSet-like things on a Windows platform with files pulled from multiple
root directories.

For example, to support <war> task, I must collect all my dependent JAR
files into one or more local directories because the <war> task only
supports a nested FileSet-like collection of files for the library files.

To support this, I thought I would copy the files I need to a local
directory.  However, the <copy> task also only supports a FileSet for the
list of files to copy.

The problem comes because the files I need to copy (in order to be
flexible) may come from different file systems that are not all connected
by a common root.  On UNIX, this is tolerable since I can always fall back
on "/" as the base directory for the FIleSet.  On Windows, as has been
pointed out, this is not an option.

Once I have the FileSet I want, I can convert it to a Path easily enough,
but I can't start with a string path of absolute filenames (perfect for a
property file) and convert it to a FileSet.

I am glad to see 1.5Beta2 include number of new extensions, but it still
seems to fall short of providing some really useful improvements.

What I would like to see is something like a FileCollection that can be
arbitrarily constructed by any of a number of subtasks like FileSet,
FileList, Path, or whatever, and automatically converted to support the
view that makes sense to the task using it.  I scanned to Ant 2.0 reqs and
did not see any discussion of this capability there either.

Roger
_______________________________________________________
Dr. Roger Cass, Architect
American Modern Insurance Group (www.amig.com)
513-947-5870


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: FileSet and FileList limitations summary

Posted by Gordon Tyler <go...@sitraka.com>.
----- Original Message -----
From: "Diane Holt" <ho...@yahoo.com>


> P.S. FileList would do for your FileCollection, if FileList gets changed
> to accept whatever list of filenames you give it without insisting on
> having a common root directory (as I've mentioned a few times already, it
> makes me crazy that it does). Of course, to further increase its
> usefulness, a lot more tasks would need to accept a FileList.

It certainly make sense to have a FileCollection interface which both
FileSet and FileList implement and which tasks will accept.

Ciao,
Gordon



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: FileSet and FileList limitations summary

Posted by Diane Holt <ho...@yahoo.com>.
--- rcass@amig.com wrote:
> Once I have the FileSet I want, I can convert it to a Path easily
> enough, but I can't start with a string path of absolute filenames
> (perfect for a property file) and convert it to a FileSet.

True -- but you can lop off the leading dir part, using a nested <map>
element, and gen a comma-separated list suitable for the 'includes'
attribute.

P.S. FileList would do for your FileCollection, if FileList gets changed
to accept whatever list of filenames you give it without insisting on
having a common root directory (as I've mentioned a few times already, it
makes me crazy that it does). Of course, to further increase its
usefulness, a lot more tasks would need to accept a FileList.

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>