2

Let's say I have this in one of my targets:

<path id="files">
   <fileset dir="${env.DIRECTORY}" casesensitive="false">
     <include name="**/*.html"/>
     <exclude name="**/*ant*"/>
    </fileset>
</path>

I'd like to group all the html files, except the ones containing the string ant. The way I wrote it above, it does not work. I also tried specifying the exclude like this:

<exclude name="*ant*"/>

Please notice that the fileset has it's case sensitiveness turned off. However, if I write:

<exclude name="**/*ant*/**"/>

This does work. Why don't the first and second versions of exclude work?

kenorb
  • 155,785
  • 88
  • 678
  • 743
Geo
  • 93,257
  • 117
  • 344
  • 520

1 Answers1

5

First and second case don't match because you are searching for directory name containing ant

Third case matches all files that have a ant element in their path, including ant as a filename.

You can also refer this Ant documentation

Ravi Gupta
  • 4,468
  • 12
  • 54
  • 85