ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuiper, Arnout" <>
Subject RE: Objections against advanced directory scanning
Date Mon, 31 Jan 2000 17:26:02 GMT
From: []


1) It seems from recent messages (please correct me here) that the scanning
is to be added into individual tasks. I would much prefer the scanning is
either added to the Project or ProjectHelper class, or a new subclass of
Task (DirectoryProcessingTask??) is introduced. 
Why? Because when new taskdefs are created by other people, they will not
inherit this behaviour, much as scanDir gets reimplemented in these tasks.
As someone writing a Task, I'd have to implement (i.e. cut & paste) it

The scanner itself is in a helper class called DirectoryScanner. For now,
the only directory scanning related 'behaviour' in the Tasks are the
setIncludes, setExcludes and setDefaultexcludes (and of course a call in the
execute method).
I agree, it would be nicer if there was a superclass for these setters, but
I want to change one thing at a time, and adding superclasses might be
tricky, especially if there are multiple base classes. So care is to be
taken here.
2) The '**' bit. Explain to me again, why with * and ? I can't match whole
directory trees, whereas with infozip I can...I'm not terribly convinced. 
The '**' is needed to cater for the following situations:
1. match files in 1 directory, but not it's subdirectories. e.g.
/test/*.java which matches all .java files in the /test/ directory.
2. match files in 1 directory, and all (or a subset of) it's subdirectories.
e.g. /test/**/*.java which matches all .java files in all directories under
3. match directories on the leafs of the tree e.g. **/CVS/* which matches
all CVS directories and their files.
If you don't have an extra special character ('**') besides the usual '*'
and '?', it is impossible to cater for all described situations.
If you can show me how to do it without '**', please tell me. I would be
very grateful.

View raw message