I am using a fileset
in Ant and I would like to have the things to exclude as an extracted property, like an array of strings(or just a comma-separated string). By doing this I can have a dynamic excludelist.
<!-- IN MY PROPERTY FILE -->
thingsToExclude = File1.java,File2.java,File3.java
<!-- IN MY BUILD.XML -->
<fileset dir="${somePath}" casesensitive="yes">
<exclude name="File1.java"/>
<exclude name="File2.java"/>
<exclude name="File3.java"/>
</fileset>
<!-- WHAT I WOULD LIKE -->
<fileset dir="${somePath}" casesensitive="yes">
<excludeList name="${thingsToExclude}"/>
</fileset>
Use
excludesfile
attribute offileset
and point to your property file, that should do the trick.Of course, you can use regex pattern like
*.java
to exclude a set of files as well.