You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Yusuf Goolamabbas <yu...@outblaze.com> on 2000/12/14 09:14:47 UTC

Compositing include/exclude in fileset

Using Ant 1.2

Hi, I am trying to write a target named "clean" which deletes all
.class file in the specified directory. That directory contains .java
files, .xml files and .txt files. I thought the following would do the
trick

<fileset dir=".">
<exclude name="*" />
<include name="*.class" />
</fileset>

This did not work, I have to specify all the exclusions individually

<target name="clean">
<delete>
<fileset dir="${srcfile}" >
<patternset id="non.test.sources" >
<exclude name="*.xml" />
<exclude name="*.java" />
<include name="*.class" />
</patternset>
</fileset>
</delete>
</target>

Is there a way to tell Ant to find the composite between excludes and
includes and use the resultant fileset for the target

Regards, Yusuf

-- 
Yusuf Goolamabbas
yusufg@outblaze.com

Re: Compositing include/exclude in fileset

Posted by Peter Donald <do...@apache.org>.
At 08:14  14/12/00 -0000, Yusuf Goolamabbas wrote:
>Using Ant 1.2
>
>Hi, I am trying to write a target named "clean" which deletes all
>.class file in the specified directory. That directory contains .java
>files, .xml files and .txt files. I thought the following would do the
>trick
>
><fileset dir=".">
><exclude name="*" />
><include name="*.class" />
></fileset>

This will do it ...

<delete>
  <fileset dir="${srcfile}" >
    <include name="*.class" />
  </fileset>
</delete>


>Is there a way to tell Ant to find the composite between excludes and
>includes and use the resultant fileset for the target

No unfortunately not.

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*