You can write like this:
<fileset dir="${src.dir}">
<exclude name="your-file-name-or-pattern"/>
<include name="your-file-name-or-pattern"/>
</fileset>
The name attribute accepts a file name and a pattern that matches multiple files.
For more information on this, see:
http://ant.apache.org/manual/Types/fileset.html
When you read this page, pay attention to selectors.
source
share