ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Köhler <>
Subject Re: pattern test/*/**
Date Tue, 01 Oct 2002 00:22:52 GMT
the attached test-case creates 3 jar which show the following:

test1.jar: (just a test)
the pattern test/** matches the folder test/ itself and it's contents

test2.jar: (BUG)
this jar does not contain test/test2.txt although the pattern test/*/** 
shouldn't match against it.

test3.har: (BUG)
this jar does not contain test3.txt although the pattern test3.txt/** 
shouldn't match against any file-name but only directories.

each of the pattern is used to exclude stuff from the created jar.

1) any pattern like a/** matches the folder a itself (but not a file 
called a) and any file/folder starting with a/ (as prooven with 
test1.jar above, and it's even a statement in ant's docs i think)
2 patterns like a/*/** should be matched partly:
if a/b/c is matched against a/*/**, the b matches the first *.
afterwords a/b/c should be matched against a/b/** (the * is replaced by 
it's match)


Stefan Bodewig wrote:
> On Sun, 29 Sep 2002, Sven Köhler <> wrote:
>>according to the rules the pattern
>>   test/asdf/**
>>matches the directory test/asdf itself, and all it's subdirectories.
> Does it match asdf itself?
>>what i try to do is to exclude all subdirectories of test/ but not
>>to exclude the files within test/
> In most cases (<fileset> for example), Ant will only work with the
> matched files and not the directories, so test/* will match the
> directories as well as the files, but Ant will ignore the directories.
> For the other issue.  Can you put together a simple testcase to plug
> into Ant's DirectoryScannerTest JUnit test so we can (1) verify the
> bug and (2) fix it.
> Stefan

View raw message