public WorkResult execute(ScalaJavaJointCompileSpec spec) { scalaCompiler.execute(spec); PatternFilterable patternSet = new PatternSet(); patternSet.include("**/*.java"); FileTree javaSource = spec.getSource().getAsFileTree().matching(patternSet); if (!javaSource.isEmpty()) { spec.setSource(javaSource); javaCompiler.execute(spec); } return new WorkResult() { public boolean getDidWork() { return true; } }; }
@Override public FileTree matching(PatternFilterable patterns) { if (tree instanceof PatternFilterableFileTree) { PatternFilterableFileTree filterableTree = (PatternFilterableFileTree) tree; return new FileTreeAdapter(filterableTree.filter(patterns)); } return super.matching(patterns); }
private SyncCopyActionDecoratorFileVisitor(Set<RelativePath> visited, PatternFilterable preserveSpec) { this.visited = visited; PatternSet preserveSet = new PatternSet(); if (preserveSpec != null) { preserveSet.include(preserveSpec.getIncludes()); preserveSet.exclude(preserveSpec.getExcludes()); } this.preserveSet = preserveSet; this.preserveSpec = preserveSet.getAsSpec(); }
/** * Sets the output directory of Sync Task and preserves the setting so it can be recovered later * via getter. */ public void setExplodedAppDirectory(File explodedAppDirectory) { this.explodedAppDirectory = explodedAppDirectory; into(explodedAppDirectory); preserve( new Action<PatternFilterable>() { @Override public void execute(PatternFilterable patternFilterable) { patternFilterable.include("WEB-INF/appengine-generated/datastore-indexes-auto.xml"); } }); }
public PatternFilterable setIncludes(Iterable<String> includes) { patterns.setIncludes(includes); return this; }
public PatternFilterable setExcludes(Iterable<String> excludes) { patterns.setExcludes(excludes); return this; }
public PatternFilterable include(String... includes) { patterns.include(includes); return this; }
public PatternFilterable include(Iterable<String> includes) { patterns.include(includes); return this; }
public PatternFilterable include(Spec<FileTreeElement> includeSpec) { patterns.include(includeSpec); return this; }
public PatternFilterable include(Closure includeSpec) { patterns.include(includeSpec); return this; }
public PatternFilterable exclude(Iterable<String> excludes) { patterns.exclude(excludes); return this; }
public PatternFilterable exclude(String... excludes) { patterns.exclude(excludes); return this; }
public PatternFilterable exclude(Spec<FileTreeElement> excludeSpec) { patterns.exclude(excludeSpec); return this; }
public PatternFilterable exclude(Closure excludeSpec) { patterns.exclude(excludeSpec); return this; }
public PatternFilterable getFilter() { return filter; }
public FileTree matching(Closure filterConfigClosure) { return matching(ClosureBackedAction.<PatternFilterable>of(filterConfigClosure)); }
@Override public FileTree matching(Action<? super PatternFilterable> filterConfigAction) { return new FilteredFileTree(filterConfigAction); }
public FileTree matching(PatternFilterable patterns) { return new FilteredFileTree(patterns); }
public FilteredFileTree(PatternFilterable patterns) { this.patterns = patterns; action = null; }
public FilteredFileTree(Action<? super PatternFilterable> action) { this.action = action; patterns = null; }
@Override public FileTree matching(Action<? super PatternFilterable> filterConfigAction) { PatternSet patternSet = new PatternSet(); filterConfigAction.execute(patternSet); return matching(patternSet); }
public FileTree matching(PatternFilterable patterns) { PatternSet patternSet = (PatternSet) patterns; return new FilteredFileTreeImpl(this, patternSet.getAsSpec()); }
public DirectoryFileTree filter(PatternFilterable patterns) { PatternSet patternSet = this.patternSet.intersect(); patternSet.copyFrom(patterns); return new DirectoryFileTree(dir, patternSet, directoryWalkerFactory, fileSystem, postfix); }
public SyncCopyActionDecorator(File baseDestDir, CopyAction delegate, PatternFilterable preserveSpec) { this.baseDestDir = baseDestDir; this.delegate = delegate; this.preserveSpec = preserveSpec; }
@Override @NonNull public PatternFilterable getFilter() { return filter; }
@Override public PatternFilterable setIncludes(Iterable<String> includes) { filter.setIncludes(includes); return this; }
@Override public PatternFilterable setExcludes(Iterable<String> excludes) { filter.setExcludes(excludes); return this; }
@Override public PatternFilterable include(String... includes) { filter.include(includes); return this; }
@Override public PatternFilterable include(Iterable<String> includes) { filter.include(includes); return this; }
@Override public PatternFilterable include(Spec<FileTreeElement> includeSpec) { filter.include(includeSpec); return this; }
@Override public PatternFilterable include(Closure includeSpec) { filter.include(includeSpec); return this; }
@Override public PatternFilterable exclude(Iterable<String> excludes) { filter.exclude(excludes); return this; }
@Override public PatternFilterable exclude(String... excludes) { filter.exclude(excludes); return this; }
@Override public PatternFilterable exclude(Spec<FileTreeElement> excludeSpec) { filter.exclude(excludeSpec); return this; }
@Override public PatternFilterable exclude(Closure excludeSpec) { filter.exclude(excludeSpec); return this; }