if (!alwaysUsePathingJar && !classpath.filter(f -> f.getAbsolutePath().contains("restli-tools-scala")).isEmpty()) { LOG.info("Compiling Scala resource classes. Disabling pathing jar for " + taskName + " to avoid breaking Scala compilation"); return classpath;
private boolean has(FileCollection fileCollection) { return fileCollection != null && !fileCollection.isEmpty(); }
private boolean has(FileCollection fileCollection) { return fileCollection != null && !fileCollection.isEmpty(); }
private void addPathArgument(final List<String> args, final String optionName, final FileCollection pathFileCollection, final Function<FileCollection, String> pathArgFromPathFileCollection) { if (! pathFileCollection.isEmpty()) { args.add(optionName); args.add(pathArgFromPathFileCollection.apply(pathFileCollection)); } }
public SpotBugsSpecBuilder(FileCollection classes) { if (classes == null || classes.isEmpty()) { throw new InvalidUserDataException("No classes configured for SpotBugs analysis."); } this.classes = classes; }
@Override public boolean isEmpty() { for (FileCollection collection : getSourceCollections()) { if (!collection.isEmpty()) { return false; } } return true; }
public SpotBugsSpecBuilder(FileCollection classes) { if(classes == null || classes.isEmpty()){ throw new InvalidUserDataException("No classes configured for SpotBugs analysis."); } this.classes = classes; }
public List<String> getAllJvmArgs() { List<String> allArgs = new ArrayList<String>(); allArgs.addAll(javaOptions.getAllJvmArgs()); if (!classpath.isEmpty()) { allArgs.add("-cp"); allArgs.add(CollectionUtils.join(File.pathSeparator, classpath.getFiles())); } return allArgs; }
@TaskAction public void generate() { FileCollection apiFiles = getSources(); if (!apiFiles.isEmpty()) { try (OutputStream output = new BufferedOutputStream(new FileOutputStream(getTarget()))) { for (File apiFile : apiFiles) { Files.copy(apiFile.toPath(), output); } } catch (IOException e) { getLogger().error("Failed to generate API file", e); } } } }
private void failOnUnsupportedFiles() { FileCollection unsupportedFiles = filterSources(new NotSpec<>(new FileExtensionSpec(IDL_EXTENSION))); if (!unsupportedFiles.isEmpty()) { throw new GradleException( String.format("Unsupported file extension for the following files: %s", unsupportedFiles)); } }
private void failOnUnsupportedFiles() { FileCollection unsupportedFiles = filterSources(new NotSpec<>(new FileExtensionSpec(PROTOCOL_EXTENSION))); if (!unsupportedFiles.isEmpty()) { throw new GradleException( String.format("Unsupported file extension for the following files: %s", unsupportedFiles)); } }
private void failOnUnsupportedFiles() { FileCollection unsupportedFiles = filterSources(new NotSpec<File>(new FileExtensionSpec(SUPPORTED_EXTENSIONS))); if (!unsupportedFiles.isEmpty()) { throw new GradleException( String.format("Unsupported file extension for the following files: %s", unsupportedFiles)); } }
@InputFiles @Optional public FileCollection getSourceFiles() { File sourceDir = getSourceDir(); if ((sourceDir == null) || !sourceDir.exists()) { return null; } Project project = getProject(); FileTree fileTree = project.fileTree(sourceDir); FileCollection fileCollection = fileTree.matching(_patternFilterable); if (fileCollection.isEmpty()) { return null; } return fileCollection; }
@InputFiles @Optional public FileCollection getSourceFiles() { File sourceDir = getSourceDir(); if ((sourceDir == null) || !sourceDir.exists()) { return null; } Project project = getProject(); FileTree fileTree = project.fileTree(sourceDir); FileCollection fileCollection = fileTree.matching(_patternFilterable); if (fileCollection.isEmpty()) { return null; } return fileCollection; }
private void configureJavadocTask(final Javadoc javadoc, final ImmutableSet<String> moduleNameIset) { setModuleNamesInputProperty(javadoc, moduleNameIset); javadoc.doFirst(task -> { final FileCollection classpath = javadoc.getClasspath(); if (! classpath.isEmpty()) { ((CoreJavadocOptions) javadoc.getOptions()).addStringOption(JAVADOC_TASK_OPTION_MODULE_PATH, classpath.getAsPath()); javadoc.setClasspath(javadoc.getProject().files()); } }); }
@TaskAction public void action() { RetrobufferExec exec = new RetrobufferExec(getProject()); exec.setInputDir(getRetrobufferInput()); exec.setOutputDir(getRetrobufferOutput()); if (getClasspath() == null || getClasspath().isEmpty()) { exec.setRetrobufferClasspath(getProject().files(getRetrobufferInput())); } else { exec.setRetrobufferClasspath(getProject().files(getRetrobufferInput(), getClasspath())); } exec.setJvmArgs(Collections.emptyList()); exec.exec(); }
/** * Test if the outputs are empty if no sources are set */ @Test public void emptyOutputs() { Download t = makeProjectAndTask(); assertTrue(t.getOutputs().getFiles().isEmpty()); }
protected void configureTaskBuildXSD(BuildXSDTask buildXSDTask) { FileCollection inputFiles = buildXSDTask.getInputFiles(); if (inputFiles.isEmpty()) { return; } Task generateTask = addTaskBuildXSDGenerate(buildXSDTask); Task compileTask = addTaskBuildXSDCompile(buildXSDTask, generateTask); buildXSDTask.from(compileTask.getOutputs()); buildXSDTask.from(generateTask.getOutputs()); TaskOutputs taskOutputs = buildXSDTask.getOutputs(); GradleUtil.addDependency( buildXSDTask.getProject(), JavaPlugin.COMPILE_CONFIGURATION_NAME, taskOutputs.getFiles()); }
private void applyRangeMap(InputSupplier inSup, OutputSupplier outSup, FileCollection srg, FileCollection exc, File rangeMap, File rangeLog) throws IOException { RangeApplier app = new RangeApplier().readSrg(srg.getFiles()); app.setOutLogger(Constants.getTaskLogStream(getProject(), this.getName() + ".log")); app.setKeepImports(this.isS2sKeepImports()); if (!exc.isEmpty()) { app.readParamMap(exc); } // for debugging. app.dumpRenameMap(); app.remapSources(inSup, outSup, rangeMap, false); }
@TaskAction public void action() { RetrolambdaExec exec = new RetrolambdaExec(getProject()); exec.setInputDir(getRetrolambdaInput()); exec.setOutputDir(getRetrolambdaOutput()); exec.setBytecodeVersion(50); if (getClasspath() == null || getClasspath().isEmpty()) { exec.setRetrolambdaClasspath(getProject().files(getRetrolambdaInput())); } else { exec.setRetrolambdaClasspath(getProject().files(getRetrolambdaInput(), getClasspath())); } exec.setDefaultMethods(true); exec.setJvmArgs(Collections.emptyList()); exec.exec(); } }