tags:

views:

73

answers:

1

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?

+1  A: 

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
Yes. It does not exclude the files containing ant.
Geo
Edited as per your response. Sorry for recommending hit n trial solution earlier :(
Ravi Gupta