ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject RE: FileSets with optional basedir and absolute paths for includes
Date Wed, 09 Mar 2005 17:35:39 GMT
--- Dominique Devienne <DDevienne@lgc.com> wrote:
> > From: Stefan Bodewig [mailto:bodewig@apache.org]
> > On Wed, 9 Mar 2005, Matt Benson
> <gudnabrsam@yahoo.com> wrote:
> > > --- Stefan Bodewig <bodewig@apache.org> wrote:
> > 
> > >> Then we could add another implementation of
> FileCollection that's
> > >> much like FileSet but doesn't require a
> basedir.
> > >
> > > Then wouldn't it still be easiest to extend AFS
> and move the
> > > "dir-not-null" checks to DirSet and FileSet, or
> to a second abstract
> > > DirbasedFileSet class and change DirSet and
> FileSet to extend that?
> > 
> > Works for me - either approach.
> 
> Well... setDir(File dir) is still on AFS. We can't
> get it out for BC,
> and having it there makes it visible to IH. Yes, you
> can throw in the
> FileBag (;-), but it's still visible to the FileBag
> API, when it really
> shouldn't be.

Doh, setDir would look ugly on AbsoluteFileSet,
wouldn't it?  <sigh> the agony of defeat.

> 
> I wouldn't -1 extending AFS, but I don't see it as
> clean.

Okay, the clean way.  Create the interface, implement
it, figure out the best way to play set operations,
and add it into the tasks.

public interface FileCollection {
    public (String or File?)[] getFiles();
}

That would be the easiest.  Now somebody think of a
better name than FileBag (_please_) for a class that
is identical to AbstractFileSet, but doesn't accept a
basedir.  AbsoluteFileSet is a nice concept but it
probably doesn't need to have FileSet in the name so
it won't be mistaken for an AFS subclass.  I think it
is sufficient to require the type selector's use to
restrict to files or directories, if not overly
friendly.  Do others think we should subclass as with
File|DirSet or rely on selectors?

Set operations are fine; the referenced bug (5035)
includes talk of nested FileSets.  FileCollection
unions, intersections and differences achieve the main
spirit of the request in 5035; however we need to have
some facility for adding additional restrictions (in
the form of exclude patterns and selectors) to an
existing FileCollection.  Among other things this
would allow (here's the carrot) the removal of the
Clone task from any shipping version of Ant!  :)  I
think the set operations should be implemented as
FileCollections rather than tasks, for use inline.  I
suppose we could have a "limit" FileCollection that
applies exclusions and selectors to a single nested
FileCollection.

> I'm -0 then. --DD

Now what are you?  :)

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


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

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


Mime
View raw message