@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); } });
private void setJvmArgs(JavaExecSpec spec, ForkOptions forkOptions) { if(forkOptions.getMemoryInitialSize() != null && !forkOptions.getMemoryInitialSize().isEmpty()) { spec.setMinHeapSize(forkOptions.getMemoryInitialSize()); } if(forkOptions.getMemoryMaximumSize() != null && !forkOptions.getMemoryMaximumSize().isEmpty()) { spec.setMaxHeapSize(forkOptions.getMemoryMaximumSize()); } List<String> args = new ArrayList<>(); //respect JAVA_OPTS, if it exists String JAVA_OPTS = System.getenv("JAVA_OPTS"); if(JAVA_OPTS != null && !JAVA_OPTS.isEmpty()) { args.add(JAVA_OPTS); } args.addAll(forkOptions.getJvmArgs()); if(Os.isFamily(Os.FAMILY_MAC)) { args.add("-Xdock:name=gosuc"); } spec.setJvmArgs((Iterable<?>) args); // Gradle 4.0 overloads JavaForkOptions#setJvmArgs; must upcast to Iterable<?> for backwards compatibility }
private void setJvmArgs( JavaExecSpec spec, ForkOptions forkOptions) { if(forkOptions.getMemoryInitialSize() != null && !forkOptions.getMemoryInitialSize().isEmpty()) { spec.setMinHeapSize(forkOptions.getMemoryInitialSize()); } if(forkOptions.getMemoryMaximumSize() != null && !forkOptions.getMemoryMaximumSize().isEmpty()) { spec.setMaxHeapSize(forkOptions.getMemoryMaximumSize()); } List<String> args = new ArrayList<>(); //respect JAVA_OPTS, if it exists String JAVA_OPTS = System.getenv("JAVA_OPTS"); if(JAVA_OPTS != null) { args.add(JAVA_OPTS); } args.addAll(forkOptions.getJvmArgs()); if(Os.isFamily(Os.FAMILY_MAC)) { args.add("-Xdock:name=gosudoc"); } spec.setJvmArgs((Iterable<?>) args); // Gradle 4.0 overloads JavaForkOptions#setJvmArgs; must upcast to Iterable<?> for backwards compatibility }
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); } }); }
exec.setJvmArgs(Arrays.asList( "-Dretrolambda.inputDir=" + inputDir, "-Dretrolambda.outputDir=" + outputDir,