use of org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner in project antlr4 by antlr.
the class Antlr4Mojo method getImportFiles.
private Set<File> getImportFiles(File sourceDirectory) throws InclusionScanException {
if (!libDirectory.exists())
return Collections.emptySet();
Set<String> includes = new HashSet<String>();
includes.add("*.g4");
includes.add("*.tokens");
SourceInclusionScanner scan = new SimpleSourceInclusionScanner(includes, Collections.<String>emptySet());
scan.addSourceMapping(new SuffixMapping("G4", "g4"));
return scan.getIncludedSources(libDirectory, null);
}
use of org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner in project jangaroo-tools by CoreMedia.
the class MavenPluginHelper method computeStaleSources.
public List<File> computeStaleSources(List<File> compileSourceRoots, Set<String> includes, Set<String> excludes, File outputDirectory, String inputFileSuffix, String outputFileSuffix, int staleMillis) throws MojoExecutionException {
SourceInclusionScanner scanner = createSourceInclusionScanner(includes, excludes, inputFileSuffix, staleMillis);
scanner.addSourceMapping(new SuffixMapping(inputFileSuffix, outputFileSuffix));
log.debug("Searching for");
Set<File> staleSources = new LinkedHashSet<File>();
for (File rootFile : compileSourceRoots) {
if (!rootFile.isDirectory()) {
continue;
}
try {
log.debug("scanner.getIncludedSources(" + rootFile + ", " + outputDirectory + ")");
// noinspection unchecked
staleSources.addAll(scanner.getIncludedSources(rootFile, outputDirectory));
} catch (InclusionScanException e) {
throw new MojoExecutionException("Error scanning source root: \'" + rootFile.getAbsolutePath() + "\' " + "for stale files to recompile.", e);
}
}
return Collections.unmodifiableList(new ArrayList<File>(staleSources));
}
Aggregations