ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: Multiple patternsets in a fileset
Date Mon, 18 Feb 2002 01:48:40 GMT
----- Original Message -----
From: "Jose Alberto Fernandez" <j_a_fernandez@yahoo.com>

> What is exactly what will break on the Datatype? Taking a look at it
> the only thing that FileSet exposes at the end is a DirectoryScanner.
> Whose only contract is to tell you:

>     1) Files/Directories that are included and not excluded
>     2) Files/Directories that were not included
>     3) Files/Directories that were included but were also excluded

4) The base directory

> Never in any of the APIs says what is the interpretation of
included/excluded.
> So, to consider each patternset of the fileset independently is definitely
> as valid as anything else.

Ok.... I suppose if its not documented anywhere then its fair game to break,
but almost assuredly folks are using multiple patternsets within a fileset
and would get bitten by this change of behavior.  I'll let the other
committers chime in if they feel differently and am currently +0 on this
change since it seems very useful but we should also consider the impact it
has.

>> For example, why do filesets all have to
>> be from the same directory tree?  Why should I not be able to group all
>> files that are within a path, for instance, and copy those somewhere or
>> include them into a .zip easily?  At the moment I have to do each one
>> individually and know each files parent directory.  I would *love* to see
>> this particular thorn removed - but the fileset API simply does not allow
>> for that.
>>

> There is no reason why you could not implement a subclass of FileSet
> that allows passing a Path of places to scan.

Sure there is.  DirectoryScanner has this:

    public File getBasedir() {
        return basedir;
    }

Lots of code relies on a DirectoryScanner being rooted at this base
directory.  DirectoryScanner makes sense based on its class name.  FileSet
does not (IMO).  I think a fileset using a DirectoryScanner is not quite
right.  Certainly its important to make a set of files for a given
directory, but it should also be possible to group scattered files together
somehow.

> OK, maybe I am naive, but is there anyone who writes multiple patterns
> expecting them to be mush together at the end? I would think that writing
> builds like that will produce incomprenhensible buildfiles.
> Can you show me a use case?

I personally don't really glue patternsets together like this.  I define
paths and filesets, and only apply a single defined patternset to a
fileset - but I do so because I know how a fileset works currently.

    Erik


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message