use of org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner in project antlr4 by antlr.
the class Antlr4Mojo method getGrammarFiles.
private Set<File> getGrammarFiles(File sourceDirectory) throws InclusionScanException {
// Which files under the source set should we be looking for as grammar files
SourceMapping mapping = new SuffixMapping("g4", Collections.<String>emptySet());
// What are the sets of includes (defaulted or otherwise).
Set<String> includes = getIncludesPatterns();
// Now, to the excludes, we need to add the imports directory
// as this is autoscanned for imported grammars and so is auto-excluded from the
// set of grammar fields we should be analyzing.
excludes.add("imports/**");
SourceInclusionScanner scan = new SimpleSourceInclusionScanner(includes, excludes);
scan.addSourceMapping(mapping);
return scan.getIncludedSources(sourceDirectory, null);
}
use of org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner in project maven-plugins by apache.
the class TestCompilerMojo method getSourceInclusionScanner.
protected SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding) {
SourceInclusionScanner scanner;
// it's not defined if we get the ending with or without the dot '.'
String defaultIncludePattern = "**/*" + (inputFileEnding.startsWith(".") ? "" : ".") + inputFileEnding;
if (testIncludes.isEmpty() && testExcludes.isEmpty()) {
testIncludes = Collections.singleton(defaultIncludePattern);
scanner = new SimpleSourceInclusionScanner(testIncludes, Collections.<String>emptySet());
} else {
if (testIncludes.isEmpty()) {
testIncludes.add(defaultIncludePattern);
}
scanner = new SimpleSourceInclusionScanner(testIncludes, testExcludes);
}
return scanner;
}
use of org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner in project maven-plugins by apache.
the class CompilerMojo method getSourceInclusionScanner.
protected SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding) {
SourceInclusionScanner scanner;
// it's not defined if we get the ending with or without the dot '.'
String defaultIncludePattern = "**/*" + (inputFileEnding.startsWith(".") ? "" : ".") + inputFileEnding;
if (includes.isEmpty() && excludes.isEmpty()) {
includes = Collections.singleton(defaultIncludePattern);
scanner = new SimpleSourceInclusionScanner(includes, Collections.<String>emptySet());
} else {
if (includes.isEmpty()) {
includes.add(defaultIncludePattern);
}
scanner = new SimpleSourceInclusionScanner(includes, excludes);
}
return scanner;
}
use of org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner 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.SimpleSourceInclusionScanner in project jangaroo-tools by CoreMedia.
the class MavenPluginHelper method createSourceInclusionScanner.
private SourceInclusionScanner createSourceInclusionScanner(Set<String> includes, Set<String> excludes, String inputFileSuffix, int staleMillis) {
SourceInclusionScanner scanner;
if (staleMillis >= 0 && includes.isEmpty() && excludes.isEmpty()) {
scanner = new StaleSourceScanner(staleMillis);
} else {
if (includes.isEmpty()) {
includes.add("**/*" + inputFileSuffix);
}
scanner = staleMillis >= 0 ? new StaleSourceScanner(staleMillis, includes, excludes) : new SimpleSourceInclusionScanner(includes, excludes);
}
log.debug("Using source inclusion scanner " + scanner);
return scanner;
}
Aggregations