use of org.gradle.workers.internal.DaemonForkOptionsBuilder in project gradle by gradle.
the class DaemonJavaCompiler method toInvocationContext.
@Override
protected InvocationContext toInvocationContext(JavaCompileSpec spec) {
ForkOptions forkOptions = spec.getCompileOptions().getForkOptions();
JavaForkOptions javaForkOptions = new BaseForkOptionsConverter(fileResolver).transform(forkOptions);
File invocationWorkingDir = javaForkOptions.getWorkingDir();
javaForkOptions.setWorkingDir(daemonWorkingDir);
DaemonForkOptions daemonForkOptions = new DaemonForkOptionsBuilder(fileResolver).javaForkOptions(javaForkOptions).sharedPackages(SHARED_PACKAGES).keepAliveMode(KeepAliveMode.SESSION).build();
return new InvocationContext(invocationWorkingDir, daemonForkOptions);
}
use of org.gradle.workers.internal.DaemonForkOptionsBuilder in project gradle by gradle.
the class DaemonScalaCompiler method toDaemonForkOptions.
@Override
protected DaemonForkOptions toDaemonForkOptions(T spec) {
MinimalJavaCompilerDaemonForkOptions javaOptions = spec.getCompileOptions().getForkOptions();
MinimalScalaCompilerDaemonForkOptions scalaOptions = spec.getScalaCompileOptions().getForkOptions();
JavaForkOptions javaForkOptions = new BaseForkOptionsConverter(forkOptionsFactory).transform(mergeForkOptions(javaOptions, scalaOptions));
javaForkOptions.setWorkingDir(daemonWorkingDir);
String javaExecutable = javaOptions.getExecutable();
if (javaExecutable != null) {
javaForkOptions.setExecutable(javaExecutable);
}
ClassPath compilerClasspath = classPathRegistry.getClassPath("SCALA-COMPILER").plus(DefaultClassPath.of(zincClasspath));
HierarchicalClassLoaderStructure classLoaderStructure = new HierarchicalClassLoaderStructure(classLoaderRegistry.getGradleWorkerExtensionSpec()).withChild(getScalaFilterSpec()).withChild(new VisitableURLClassLoader.Spec("compiler", compilerClasspath.getAsURLs()));
return new DaemonForkOptionsBuilder(forkOptionsFactory).javaForkOptions(javaForkOptions).withClassLoaderStructure(classLoaderStructure).keepAliveMode(KeepAliveMode.SESSION).build();
}
Aggregations