if(includes.isEmpty()) {
includes.add("**/*.*"); // if no include is specified, include everything
}
SourceInclusionScanner scanner = new SimpleSourceInclusionScanner(includes, excludes);
// Note: we must declare a dummy "source mapping", or the Plexus SimpleSourceInclusionScanner won't work
// (as per http://maven.apache.org/plugins/maven-clover-plugin/2.4/xref/org/apache/maven/plugin/clover/CloverInstrumentInternalMojo.html )
scanner.addSourceMapping( new SuffixMapping( "dummy", "dummy" ) );
try {
outputManifestFile.getParentFile().mkdirs();
outputManifestFile.createNewFile(); // create it if it doesn't yet exist
} catch (IOException e) {
getLog().error("IOException creating manifest file: " + outputManifestFile.toString(), e);
return;
}
try {
// the manifest looks much nicer sorted - sort the set
SortedSet<File> includedFiles = new TreeSet<File>((Set<File>)scanner.getIncludedSources(inputDirectory, null));
Writer w = new BufferedWriter(new FileWriter(outputManifestFile));
// build the header
w.write("CACHE MANIFEST\n\n");