org.gradle.api.tasks.compile.ForkOptions Java Examples

The following examples show how to use org.gradle.api.tasks.compile.ForkOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClojureCheck.java    From clojurephant with Apache License 2.0 6 votes vote down vote up
public ClojureCheck() {
  this.clojureExecutor = new ClojureExecutor(getProject());
  this.sourceRoots = getProject().files();
  this.classpath = getProject().files();
  this.outputFile = getProject().getObjects().fileProperty();
  this.reflection = getProject().getObjects().property(ClojureReflection.class);
  this.forkOptions = new ForkOptions();
  this.namespaces = getProject().getObjects().setProperty(String.class);

  outputFile.set(new File(getTemporaryDir(), "internal.txt"));

  // skip if no namespaces defined
  onlyIf(task -> {
    return !getNamespaces().getOrElse(Collections.emptySet()).isEmpty();
  });
}
 
Example #2
Source File: DaemonJavaCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public WorkResult execute(JavaCompileSpec spec) {
    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    DaemonForkOptions daemonForkOptions = new DaemonForkOptions(
            forkOptions.getMemoryInitialSize(), forkOptions.getMemoryMaximumSize(), forkOptions.getJvmArgs(),
            Collections.<File>emptyList(), Collections.singleton("com.sun.tools.javac"));
    CompilerDaemon daemon = compilerDaemonManager.getDaemon(project.getRootProject().getProjectDir(), daemonForkOptions);
    CompileResult result = daemon.execute(delegate, spec);
    if (result.isSuccess()) {
        return result;
    }
    throw UncheckedException.throwAsUncheckedException(result.getException());
}
 
Example #3
Source File: ClojureCompile.java    From clojurephant with Apache License 2.0 5 votes vote down vote up
public ClojureCompile() {
  this.clojureExecutor = new ClojureExecutor(getProject());
  this.destinationDir = getProject().getObjects().directoryProperty();
  this.sourceRoots = getProject().files();
  this.classpath = getProject().files();
  this.options = new ClojureCompileOptions();
  this.forkOptions = new ForkOptions();
  this.namespaces = getProject().getObjects().setProperty(String.class);

  // skip if no namespaces defined
  onlyIf(task -> {
    return !getNamespaces().getOrElse(Collections.emptySet()).isEmpty();
  });
}
 
Example #4
Source File: JavaCompilerArgumentsBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addLauncherOptions() {
    if (!includeLauncherOptions) { return; }

    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    if (forkOptions.getMemoryInitialSize() != null) {
        args.add("-J-Xms" + forkOptions.getMemoryInitialSize().trim());
    }
    if (forkOptions.getMemoryMaximumSize() != null) {
        args.add("-J-Xmx" + forkOptions.getMemoryMaximumSize().trim());
    }
    if (forkOptions.getJvmArgs() != null) {
        args.addAll(forkOptions.getJvmArgs());
    }
}
 
Example #5
Source File: ClojureScriptCompile.java    From clojurephant with Apache License 2.0 5 votes vote down vote up
public ClojureScriptCompile() {
  this.clojureExecutor = new ClojureExecutor(getProject());
  this.destinationDir = getProject().getObjects().directoryProperty();
  this.sourceRoots = getProject().files();
  this.classpath = getProject().files();
  this.options = new ClojureScriptCompileOptions(getProject(), destinationDir);
  this.forkOptions = new ForkOptions();
}
 
Example #6
Source File: DaemonJavaCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected DaemonForkOptions toDaemonOptions(JavaCompileSpec spec) {
    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(
            forkOptions.getMemoryInitialSize(), forkOptions.getMemoryMaximumSize(), forkOptions.getJvmArgs(),
            Collections.<File>emptyList(), Collections.singleton("com.sun.tools.javac"));
}
 
Example #7
Source File: DaemonJavaCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public WorkResult execute(JavaCompileSpec spec) {
    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    DaemonForkOptions daemonForkOptions = new DaemonForkOptions(
            forkOptions.getMemoryInitialSize(), forkOptions.getMemoryMaximumSize(), forkOptions.getJvmArgs(),
            Collections.<File>emptyList(), Collections.singleton("com.sun.tools.javac"));
    CompilerDaemon daemon = compilerDaemonManager.getDaemon(project.getRootProject().getProjectDir(), daemonForkOptions);
    CompileResult result = daemon.execute(delegate, spec);
    if (result.isSuccess()) {
        return result;
    }
    throw UncheckedException.throwAsUncheckedException(result.getException());
}
 
Example #8
Source File: JavaCompilerArgumentsBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addLauncherOptions() {
    if (!includeLauncherOptions) { return; }

    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    if (forkOptions.getMemoryInitialSize() != null) {
        args.add("-J-Xms" + forkOptions.getMemoryInitialSize().trim());
    }
    if (forkOptions.getMemoryMaximumSize() != null) {
        args.add("-J-Xmx" + forkOptions.getMemoryMaximumSize().trim());
    }
    if (forkOptions.getJvmArgs() != null) {
        args.addAll(forkOptions.getJvmArgs());
    }
}
 
Example #9
Source File: JavaCompilerArgumentsBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addLauncherOptions() {
    if (!includeLauncherOptions) { return; }

    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    if (forkOptions.getMemoryInitialSize() != null) {
        args.add("-J-Xms" + forkOptions.getMemoryInitialSize().trim());
    }
    if (forkOptions.getMemoryMaximumSize() != null) {
        args.add("-J-Xmx" + forkOptions.getMemoryMaximumSize().trim());
    }
    if (forkOptions.getJvmArgs() != null) {
        args.addAll(forkOptions.getJvmArgs());
    }
}
 
Example #10
Source File: DaemonJavaCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected DaemonForkOptions toDaemonOptions(JavaCompileSpec spec) {
    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(
            forkOptions.getMemoryInitialSize(), forkOptions.getMemoryMaximumSize(), forkOptions.getJvmArgs(),
            Collections.<File>emptyList(), Collections.singleton("com.sun.tools.javac"));
}
 
Example #11
Source File: JavaCompilerArgumentsBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addLauncherOptions() {
    if (!includeLauncherOptions) { return; }

    ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
    if (forkOptions.getMemoryInitialSize() != null) {
        args.add("-J-Xms" + forkOptions.getMemoryInitialSize().trim());
    }
    if (forkOptions.getMemoryMaximumSize() != null) {
        args.add("-J-Xmx" + forkOptions.getMemoryMaximumSize().trim());
    }
    if (forkOptions.getJvmArgs() != null) {
        args.addAll(forkOptions.getJvmArgs());
    }
}
 
Example #12
Source File: DaemonScalaCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(ScalaJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #13
Source File: DaemonGroovyCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(GroovyJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #14
Source File: DaemonGroovyCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(GroovyJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #15
Source File: DaemonScalaCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(ScalaJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #16
Source File: ClojureNRepl.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
public ClojureNRepl forkOptions(Action<? super ForkOptions> configureAction) {
  configureAction.execute(forkOptions);
  return this;
}
 
Example #17
Source File: ClojureCompile.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@Nested
public ForkOptions getForkOptions() {
  return forkOptions;
}
 
Example #18
Source File: ClojureNRepl.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@Nested
public ForkOptions getForkOptions() {
  return forkOptions;
}
 
Example #19
Source File: ClojureCheck.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
public void forkOptions(Action<? super ForkOptions> configureAction) {
  configureAction.execute(forkOptions);
}
 
Example #20
Source File: ClojureCheck.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@Nested
public ForkOptions getForkOptions() {
  return forkOptions;
}
 
Example #21
Source File: ClojureCompile.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
public void forkOptions(Action<? super ForkOptions> configureAction) {
  configureAction.execute(forkOptions);
}
 
Example #22
Source File: DaemonScalaCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(ScalaJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #23
Source File: ClojureScriptCompile.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
public void forkOptions(Action<? super ForkOptions> configureAction) {
  configureAction.execute(forkOptions);
}
 
Example #24
Source File: ClojureScriptCompile.java    From clojurephant with Apache License 2.0 4 votes vote down vote up
@Nested
public ForkOptions getForkOptions() {
  return forkOptions;
}
 
Example #25
Source File: MinimalJavaCompileOptions.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public void setForkOptions(ForkOptions forkOptions) {
    this.forkOptions = forkOptions;
}
 
Example #26
Source File: MinimalJavaCompileOptions.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public ForkOptions getForkOptions() {
    return forkOptions;
}
 
Example #27
Source File: DaemonGroovyCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(GroovyJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #28
Source File: DaemonScalaCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(ScalaJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
 
Example #29
Source File: DaemonGroovyCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DaemonForkOptions createJavaForkOptions(GroovyJavaJointCompileSpec spec) {
    ForkOptions options = spec.getCompileOptions().getForkOptions();
    return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}