ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Solofnenko <>
Subject RE: Any chance for fileset arithmetic?
Date Wed, 30 Jul 2003 16:07:58 GMT
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

- Alexey.

{ } Alexey N. Solofnenko
Pleasant Hill, CA (GMT-8 usually)

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

On Tue, 29 Jul 2003, Alexey Solofnenko <> 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>?).


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.


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


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message