@SuppressFBWarnings(value = "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT", justification = "FindBugs thinks that setClasspath() doesn't have a side effect, but it actually does.") private void modifyClassPath(JavaExecSpec execSpec) { if (workingDirectory != null) { execSpec.setWorkingDir(workingDirectory); } FileCollection classpath = execSpec.getClasspath(); execSpec.setClasspath(classpath.filter(file -> { String name = file.getName(); if (name.startsWith("org.eclipse") && !name.startsWith("org.eclipse.osgi")) { return false; } else { return true; } })); if (vmArgs != null) { execSpec.jvmArgs(vmArgs); } }
javaExecSpec.setWorkingDir((Object) _project.getProjectDir()); // Gradle 4.0 overloads ProcessForkOptions#setWorkingDir; must upcast to Object for backwards compatibility setJvmArgs(javaExecSpec, _options.getForkOptions()); javaExecSpec.setMain("gw.gosudoc.cli.Gosudoc")
javaExecSpec.setWorkingDir((Object) _project.getProjectDir()); // Gradle 4.0 overloads ProcessForkOptions#setWorkingDir; must upcast to Object for backwards compatibility setJvmArgs(javaExecSpec, _spec.getGosuCompileOptions().getForkOptions()); javaExecSpec.setMain("gw.lang.gosuc.cli.CommandLineCompiler")
@Override public WorkResult execute(JavaCompileSpec javaCompileSpec) { LOGGER.info("Compiling sources using eclipse compiler for java ["+this.ecjArtifact+"]"); final List<String> remainingArguments = new JavaCompilerArgumentsBuilder(javaCompileSpec).includeSourceFiles(true).build(); ExecResult result = project.javaexec(exec -> { exec.setWorkingDir(javaCompileSpec.getWorkingDir()); exec.setClasspath(compilerConfiguration); exec.setMain("org.eclipse.jdt.internal.compiler.batch.Main"); exec.args(shortenArgs(javaCompileSpec.getTempDir(), remainingArguments)); }); if (result.getExitValue() != 0) { throw new CompilationFailedException(result.getExitValue()); } return () -> true; }