You  are right, this feature will require to change a lot of tasks. But the
change will be to remove most of fileset specific code. Even more there
should be no difference between <fileset> and <filelist> usage. 

I agree, it might be not easy. Some tasks like <javac> (third-party-tool) or
<delete> (source file access) require real filesets ("constructed" filesets
might also work with virtual file system, but it maybe too difficult to
implement). But even in this case a single base directory should not be
required. Some other tasks (<zip>, <copy>, <sync>) can work with
"constructed" filesets. Even more, it would be possible to write archive
file fileset, so <copy> could extract files from archives. So maybe
"constructed fileset" is different fileset type that some tasks can work
with.

- Alexey.

--
{ http://trelony.cjb.net/ } Alexey N. Solofnenko
Pleasant Hill, CA (GMT-8 usually)

-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 12:09 AM
To: [EMAIL PROTECTED]
Subject: Re: Any chance for fileset arithmetic?

On Tue, 29 Jul 2003, Alexey Solofnenko <[EMAIL PROTECTED]> wrote:

> but a <fileset> or a <filelist> is essentially a collection of data
> files with names

Not in the case of <fileset>.

> (isn't logically <filelist> an ordered <fileset>?).

No.

A <fileset> is a set of names of existing files rooted in the same
base directory.  There are lots of tasks that do

String[] files = ds.getIncludedFiles();
File base = fs.getDir(getProject());
for (i = 0; i < files.length; i++) {
    File f = new File(base, files[i]);

that would fail horribly if f didn't exist.

> There is no reason for the names to be exactly as they are in the
> file system.

See above.

> Some special tasks like <delete> need to access original files.

All tasks need to.  Some task could want to morph the name into
something else after they have accessed the original file.

> Some other tasks like <copy> or <zip> need only data from the files.
> They do not really care about original file names.

Uhm, OK, if you want to put it that way, maybe.

But be careful, <move> will try to File#renameTo the original file, so
it will need the file names as well.  <zip> will need the original
file names of files in <zipgroupfileset>s in order to create
<zipfileset> from them.

There are not too many tasks that could be made to work without access
to the original file names, at least that's my rough guess.

> Right now tasks have to be aware about any extra fileset
> functionality they support (<zipfileset>, <tarfileset>,...). So the
> proposal is to make it generic.

How?

I don't see how this could be done without changing all tasks.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to