Search in sources :

Example 1 with BaseForkOptions

use of org.gradle.api.tasks.compile.BaseForkOptions in project gradle by gradle.

the class DaemonPlayCompiler method toInvocationContext.

@Override
protected InvocationContext toInvocationContext(PlayCompileSpec spec) {
    BaseForkOptions forkOptions = spec.getForkOptions();
    JavaForkOptions javaForkOptions = new BaseForkOptionsConverter(fileResolver).transform(forkOptions);
    File invocationWorkingDir = javaForkOptions.getWorkingDir();
    javaForkOptions.setWorkingDir(daemonWorkingDir);
    DaemonForkOptions daemonForkOptions = new DaemonForkOptionsBuilder(fileResolver).javaForkOptions(javaForkOptions).classpath(compilerClasspath).sharedPackages(classLoaderPackages).keepAliveMode(KeepAliveMode.SESSION).build();
    return new InvocationContext(invocationWorkingDir, daemonForkOptions);
}
Also used : DaemonForkOptionsBuilder(org.gradle.workers.internal.DaemonForkOptionsBuilder) BaseForkOptionsConverter(org.gradle.api.internal.tasks.compile.BaseForkOptionsConverter) DaemonForkOptions(org.gradle.workers.internal.DaemonForkOptions) JavaForkOptions(org.gradle.process.JavaForkOptions) File(java.io.File) BaseForkOptions(org.gradle.api.tasks.compile.BaseForkOptions)

Example 2 with BaseForkOptions

use of org.gradle.api.tasks.compile.BaseForkOptions in project gradle by gradle.

the class AbstractDaemonCompiler method mergeForkOptions.

protected BaseForkOptions mergeForkOptions(BaseForkOptions left, BaseForkOptions right) {
    BaseForkOptions merged = new BaseForkOptions();
    merged.setMemoryInitialSize(mergeHeapSize(left.getMemoryInitialSize(), right.getMemoryInitialSize()));
    merged.setMemoryMaximumSize(mergeHeapSize(left.getMemoryMaximumSize(), right.getMemoryMaximumSize()));
    Set<String> mergedJvmArgs = normalized(left.getJvmArgs());
    mergedJvmArgs.addAll(normalized(right.getJvmArgs()));
    merged.setJvmArgs(Lists.newArrayList(mergedJvmArgs));
    return merged;
}
Also used : BaseForkOptions(org.gradle.api.tasks.compile.BaseForkOptions)

Aggregations

BaseForkOptions (org.gradle.api.tasks.compile.BaseForkOptions)2 File (java.io.File)1 BaseForkOptionsConverter (org.gradle.api.internal.tasks.compile.BaseForkOptionsConverter)1 JavaForkOptions (org.gradle.process.JavaForkOptions)1 DaemonForkOptions (org.gradle.workers.internal.DaemonForkOptions)1 DaemonForkOptionsBuilder (org.gradle.workers.internal.DaemonForkOptionsBuilder)1