ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuiper, Arnout" <Arnout.Kui...@nl.origin-it.com>
Subject RE: Objections against advanced directory scanning
Date Tue, 01 Feb 2000 09:03:14 GMT
From: dion@multitask.com.au [mailto:dion@multitask.com.au]
> It could refer to a directory or multiple directories, i.e.
> Includes="/test/*/*.java" recurse="true"
> matches to /test/a/a.java and to /test/a/b/c/d.java

The problem with this approach is, you got a package deal,
1) With recurse=true, all * match zero (one?) or more directories.
2) With recurse=false, all * match one directory.

In my opinion, using '**' gives you more expressive power, such
that you can use a combination of 1 & 2:

/test/*/**/foo/**/bar/*/*.java
(Matches every .java file, with the path starting with 'test',
then 1 or more directories ('*/**'), then 'foo', then zero or
more directories ('**'), then 'bar', then 1 directory, and then
the filename).

This could be matched with recurse == true, when '*' on it's own
means zero or more directories. The expression would then be:
/test/?*/*/foo/*/bar/?*/*.java
You only move the problem. Now you have to use '?*' instead of '*',
and '*' instead of '**'. Personally, I problems with the double meaning
of a single '*'. In one situation it means zero or more characters,
in another situation it means zero or more directories. So the user
might be puzzled, due to the double meaning. '*.java', does that
match only 'xyz.java', or also 'abc/def/xyz.java'?

Furthermore, the recurse attribute should not be necessary, because
you can match anything if you recurse always.

Cheers,

  Arnout


Mime
View raw message