How can I include a set of files in a fileset ant task when they are externally supplied from say a java program or as an xml file?
Conventionally we use the include and exclude regex for these kind of customization,
<fileset ...>
<include name="**/*Test.java" />
<exclude name="**/*.txt" />
But I do not know anything about the files to be included, to impose a condition on them as in this case we already know that we should include java files that end with test and ignore txt files..
The files to be included and excluded will be provided from an external source like a java program or as an xml format.. How can I include them in the fileset in such a case?
Figured out a way to do this..Included a groovy task within the ant script to get this done.. Say I have an
input.xmllike this :that gives details about the classes to be included..I parse the file using a simple groovy parser and configure a new property in the ant that specifies the set of classes to be included..
The new property is :
The groovy script that reads the external input and sets the property is :
Now the newly set property is used by ant script below to include the necessary classes :