@Override public void execute(JavaExecSpec exec) { exec.classpath(forkedClasspath); exec.setMain(FernFlowerInvoker.class.getName()); exec.setJvmArgs(ImmutableList.of("-Xmx3G")); // pass the temporary file exec.args(data); // Forward std streams exec.setStandardOutput(System.out); exec.setErrorOutput(System.err); } });
@Override public void execute(JavaExecSpec executor) { executor.classpath(classpath); executor.setMain("org.javacc.jjdoc.JJDocMain"); executor.args((Object[]) arguments.toArray()); executor.setIgnoreExitValue(true); } }
@Override public void execute(JavaExecSpec executor) { executor.classpath(classpath); executor.setMain("org.javacc.jjtree.Main"); executor.args((Object[]) arguments.toArray()); executor.setIgnoreExitValue(true); } }
@Override public void execute(JavaExecSpec executor) { executor.classpath(classpath); executor.setMain("org.javacc.parser.Main"); executor.args((Object[]) arguments.toArray()); executor.setIgnoreExitValue(true); } }
public void exec() { project.javaexec(exec -> { exec.setClasspath(project.getBuildscript().getConfigurations().getByName("classpath")); String path = retrobufferClasspath.getAsPath(); exec.setMain("org.javafxports.retrobuffer.Main"); exec.setJvmArgs(Arrays.asList( "-Dretrobuffer.inputDir=" + inputDir, "-Dretrobuffer.outputDir=" + outputDir, "-Dretrobuffer.classpath=" + path )); if (classpathLengthGreaterThanLimit(path)) { try { File classpathFile = File.createTempFile("inc-", ".path"); try (BufferedWriter writer = Files.newBufferedWriter(classpathFile.toPath(), StandardCharsets.UTF_8)) { for (File item : this.retrobufferClasspath) { writer.write(item.toString() + "\n"); } } classpathFile.deleteOnExit(); exec.getJvmArgs().add("-Dretrobuffer.classpathFile=" + classpathFile.getAbsolutePath()); } catch (IOException e) { } } else { exec.getJvmArgs().add("-Dretrobuffer.classpath=" + path); } for (String arg : jvmArgs) { exec.getJvmArgs().add(arg); } }); }
public void doCall(JavaExecSpec javaExecSpec) { javaExecSpec.setMain("org.apache.axis.wsdl.WSDL2Java") .args(arguments) .setClasspath(getProject().getConfigurations().getByName("compile")); } });
public void exec(ClojureExecSpec cljSpec) { FileCollection fullClasspath = cljSpec.getClasspath(); project.javaexec(spec -> { spec.setMain("clojure.main"); spec.args("-m", cljSpec.getMain()); String ednArgs = Edn.print(Arrays.asList(cljSpec.getArgs())); ByteArrayInputStream input = new ByteArrayInputStream(ednArgs.getBytes(StandardCharsets.UTF_8)); spec.setStandardInput(input); spec.setClasspath(fullClasspath); cljSpec.getConfigureFork().forEach(forkAction -> forkAction.execute(spec)); spec.systemProperty("gradle-clojure.tools.logger.level", getLogLevel()); }); }
public void exec(ClojureExecSpec cljSpec) { FileCollection fullClasspath = cljSpec.getClasspath(); project.javaexec(spec -> { spec.setMain("clojure.main"); spec.args("-m", cljSpec.getMain()); String ednArgs = Edn.print(Arrays.asList(cljSpec.getArgs())); ByteArrayInputStream input = new ByteArrayInputStream(ednArgs.getBytes(StandardCharsets.UTF_8)); spec.setStandardInput(input); spec.setClasspath(fullClasspath); cljSpec.getConfigureFork().forEach(forkAction -> forkAction.execute(spec)); spec.systemProperty("gradle-clojure.tools.logger.level", getLogLevel()); }); }
exec.setMain("net.orfjackal.retrolambda.Main"); exec.setJvmArgs(Arrays.asList( "-Dretrolambda.inputDir=" + inputDir,
javaExecSpec.setMain("gw.gosudoc.cli.Gosudoc") .setClasspath(_project.files(classpathJar))
execSpec.setMain(JavaExecable.class.getName());
private void execute(Action<JavaExecSpec> execSpecAction, TestResultProcessor resultProcessor) { Object rootTestId = "eta-test-root"; Object testId = "eta-test"; resultProcessor.started (new DefaultTestSuiteDescriptor(rootTestId, "Eta Root"), new TestStartEvent(System.currentTimeMillis())); resultProcessor.started (new DefaultTestDescriptor(testId, "eta.main", "Default Eta Test"), new TestStartEvent(System.currentTimeMillis())); ExecResult execResult = project.javaexec(execSpec -> { execSpecAction.execute(execSpec); execSpec.setMain("eta.main"); }); ResultType resultType = (execResult.getExitValue() == 0)? ResultType.SUCCESS : ResultType.FAILURE; resultProcessor.completed (testId, new TestCompleteEvent(System.currentTimeMillis(), resultType)); resultProcessor.completed (rootTestId, new TestCompleteEvent(System.currentTimeMillis(), resultType)); } }
javaExecSpec.setMain("gw.lang.gosuc.cli.CommandLineCompiler") .setClasspath(spec.getGosuClasspath().call().plus(_project.files(Util.findToolsJar())))
delombok.setMain("lombok.launch.Main"); delombok.args("delombok");
@Override public void execute(JavaExecSpec spec) { getLogger().lifecycle(CONFIG_MESSAGE, getFormat(), formatPath(getBaseDir()), formatPath(getDestDir())); getLogger().info("Using main class {}", getMainClass()); Configuration configuration = getProject().getConfigurations().getAt(CONFIGURATION_NAME); String toolPath = configuration.getAsPath(); spec.setIgnoreExitValue(true); spec.setClasspath(createToolClasspath(configuration)); spec.setMain(getMainClass()); spec.args(getFormat(), getBaseDir().getAbsolutePath(), getDestDir().getAbsolutePath(), toolPath); }
@Override public void execute(JavaExecSpec javaExecSpec) { javaExecSpec.classpath(new File(javaProcessInfo.getClasspath())); javaExecSpec.setMain(javaProcessInfo.getMainClass()); javaExecSpec.args(javaProcessInfo.getArgs()); javaExecSpec.jvmArgs(javaProcessInfo.getJvmArgs()); javaExecSpec.environment(javaProcessInfo.getEnvironment()); javaExecSpec.setStandardOutput(processOutput.getStandardOutput()); javaExecSpec.setErrorOutput(processOutput.getErrorOutput()); // we run by default in headless mode, so the forked JVM doesn't steal focus. javaExecSpec.systemProperty("java.awt.headless", "true"); // we want the caller to be able to do its own thing. javaExecSpec.setIgnoreExitValue(true); } }
@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; }
javaExecSpec.setMain(main); javaExecSpec.setDebug(isDebug());