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 Tue, 01 Feb 2000 09:03:14 GMT
From: []
> It could refer to a directory or multiple directories, i.e.
> Includes="/test/*/*.java" recurse="true"
> matches to /test/a/ and to /test/a/b/c/

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:

(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:
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 '', or also 'abc/def/'?

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



View raw message