ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ludovic Claude>
Subject Re: [PROPOSAL] Directory scanning into a helper class (reuse + improvement)
Date Fri, 21 Jan 2000 17:17:04 GMT

That would be helpful indeed, for example to select only the set of 'support
that you really need when you execute javac.

Is this helper class available in cvs?


Ludovic Claude

"Kuiper, Arnout" wrote:

> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Hi,
> After updating the manual last night (and a number of questions
> regarding Ant in my mailbox), I came to the conclusion that the
> inclusion/exclusion of sets of files, is done separately by a bunch of
> tasks, and could be improved a lot.
> A lot of tasks have a base-directory, and a set of items that should
> be included. Sometimes there is also an ignore attribute, to ignore
> files/directories that have a certain name. Couldn't this be
> standardized, made more flexible, etc...
> I developed a helper class that given a basedir, a set of include
> patterns and a set of exclude patterns, scans the given basedir, for
> files that match one of the include patterns, and don't match any of
> the exclude patterns. As a result the set of valid files is returned.
> It could be used easily in the following tasks:
> -copydir (inclusion/exclusion of files to copy)
> -jar     (inclusion/exclusion of files to jar)
> -javac   (inclusion/exclusion of files to compile)
> -zip     (inclusion/exclusion of files to zip)
> Also the creation of new tasks, that are based on a directory
> structure, is much simpler.
> Advantages:
> -Tasks behave the same for the user.
> -Easier to document in the manual.
> -Better pattern matching.
> -Less duplicated code.
> Pattern matching is based on UNIX pattern matching. Matching is done
> per directory name (name between two separators). In the pattern for
> such a name, the following special characters can be used:
> * matches zero or more characters
> ? matches one character
> When the pattern for a directory name is '**', it matches zero or more
> directories.
> So "**/?d*.java" matches "", "test/",
> "d1/d2/", but not "" (no 'd') and "test/xd.bat"
> (no '.java').
> What do you think of this?
> Arnout Kuiper

Web Site Watchers Ltd
212 Piccadilly,
London W1V 9LD

Telephone: +44 (0)171 917 6255
Fax: +44 (0)171 439 0262

View raw message