If I have a fileset like this:
<fileset dir=".">
<exclude name="classes/*"/>
<include name="**/zar.class"/>
</fileset>
The exclude takes precedence over the include and I don't end up with any classes. [since for this hypothetical example, zar.class is in the classes dir] I would like to include the zar file, even though it is in the classes dir.
I banged my head against this one for a while, reading about selectors, patternsets, filesets, trying to combine filesets, etc. but could not get it working.
Anyone know how to do this?
Description. Alters the default excludes for all subsequent processing in the build, and prints out the current default excludes if desired.
A FileSet is a group of files. These files can be found in a directory tree starting in a base directory and are matched by patterns taken from a number of PatternSets and Selectors. PatternSets can be specified as nested <patternset> elements.
Why do you need the exclude element ?
<fileset dir=".">
<include name="**/zar.class"/>
</fileset>
should give you the exact set of files you are after: zar.class, and none of the other .class
files in classes/.
Just put this in community wiki mode, because I am not sure, on second thought, that it is actually what you are after:
you may want everything, including classes/.../zar.class, except classes/....
My solution would only give you zar.class.
Please leave a comment: if this is not a good solution, I will remove it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With