/** * Run wsimport */ @TaskAction protected void wsimport() { Objects.requireNonNull(getWsdls()).visit(new EmptyFileVisitor() { /** * @see org.gradle.api.file.EmptyFileVisitor#visitFile(org.gradle.api.file.FileVisitDetails) */ @Override public void visitFile(FileVisitDetails file) { Path relativeWsdlFile = Paths.get(file.getPath()); Path absoluteWsdlFile = file.getFile().toPath(); if (relativeWsdlFile.isAbsolute() || !absoluteWsdlFile.isAbsolute()) { throw new IllegalArgumentException(String.format("Illegal file visit details %s", file)); } Path baseDir = Objects.requireNonNull(absoluteWsdlFile.getRoot()).resolve( absoluteWsdlFile.subpath(0, absoluteWsdlFile.getNameCount() - relativeWsdlFile.getNameCount())); runWsimport(baseDir, relativeWsdlFile); } }); }
protected void handleDiscoveredInputs(T spec, IncrementalCompilation compilation, final DiscoveredInputRecorder discoveredInputRecorder) { for (File includeFile : compilation.getDiscoveredInputs()) { discoveredInputRecorder.newInput(includeFile); } if (sourceFilesUseMacroIncludes(spec.getSourceFiles(), compilation.getFinalState())) { LOGGER.info("After parsing the source files, Gradle cannot calculate the exact set of include files for {}. Every file in the include search path will be considered an input.", task.getName()); for (final File includeRoot : spec.getIncludeRoots()) { LOGGER.info("adding files in {} to discovered inputs for {}", includeRoot, task.getName()); directoryFileTreeFactory.create(includeRoot).visit(new EmptyFileVisitor() { @Override public void visitFile(FileVisitDetails fileDetails) { discoveredInputRecorder.newInput(fileDetails.getFile()); } }); } } }
public Set<? extends LocallyAvailableResource> search(String pattern) { if (!getBaseDir().exists()) { return Collections.emptySet(); } final Set<LocallyAvailableResource> entries = new HashSet<LocallyAvailableResource>(); findFiles(pattern).visit(new EmptyFileVisitor() { public void visitFile(FileVisitDetails fileDetails) { final File file = fileDetails.getFile(); // We cannot clean in progress markers, or in progress files here because // the file system visitor stuff can't handle the file system mutating while visiting if (!isInProgressMarkerFile(file) && !isInProgressFile(file)) { entries.add(entryAt(file)); } } }); return entries; }