private Set<DirectoryTree> doGetSrcDirTrees() { Set<DirectoryTree> result = new LinkedHashSet<DirectoryTree>(); for (Object path : source) { if (path instanceof SourceDirectorySet) { SourceDirectorySet nested = (SourceDirectorySet) path; result.addAll(nested.getSrcDirTrees()); } else { for (File srcDir : fileResolver.resolveFiles(path)) { if (srcDir.exists() && !srcDir.isDirectory()) { throw new InvalidUserDataException(String.format("Source directory '%s' is not a directory.", srcDir)); } result.add(directoryFileTreeFactory.create(srcDir, patterns)); } } } return result; }
@TaskAction public void run() throws IOException { final PatternSet patternSet = new PatternSet(); patternSet.setIncludes(this.input.getIncludes()); patternSet.setExcludes(this.input.getExcludes()); for (final DirectoryTree dirTree : this.input.getSrcDirTrees()) { final File dir = dirTree.getDir(); if (!dir.exists() || !dir.isDirectory()) { continue; } final FileTree tree = this.getProject().fileTree(dir).matching(this.input.getFilter()).matching(patternSet); for (final File file : tree) { final Map<Integer, String> matches = this.getFileMatches(Files.toString(file, Charsets.UTF_8)); if (!matches.isEmpty()) { System.out.println(); LOGGER.warn("{} TODO{} found in `{}`", matches.size(), matches.size() == 1 ? "" : "s", file.getName()); for (final Map.Entry<Integer, String> match : matches.entrySet()) { LOGGER.warn("L{}: {}", match.getKey(), match.getValue().trim()); } } } } }
private String tryFindSourceSetPath(final String sourceSetName) { try { if (getProject().getPlugins().findPlugin(JavaPlugin.class) != null) { final SourceSetContainer sourceSets = (SourceSetContainer) getProject().getProperties() .get(SOURCE_SETS_PROPERTY); if (sourceSets != null) { return sourceSets.getByName(sourceSetName).getJava().getSrcDirTrees().iterator().next().getDir() .getAbsolutePath(); } } } finally { } return null; }
final Multimap<String, Map<String, String>> fileReplacements = this.resolveReplacementsByFile(); for (final DirectoryTree dirTree : this.input.getSrcDirTrees()) { File dir = dirTree.getDir();
for (DirectoryTree dirTree : source.getSrcDirTrees())