use of org.gradle.api.tasks.compile.GroovyForkOptions in project gradle by gradle.
the class DaemonGroovyCompiler method toInvocationContext.
@Override
protected InvocationContext toInvocationContext(GroovyJavaJointCompileSpec spec) {
ForkOptions javaOptions = spec.getCompileOptions().getForkOptions();
GroovyForkOptions groovyOptions = spec.getGroovyCompileOptions().getForkOptions();
// Ant is optional dependency of groovy(-all) module but mandatory dependency of Groovy compiler;
// that's why we add it here. The following assumes that any Groovy compiler version supported by Gradle
// is compatible with Gradle's current Ant version.
Collection<File> antFiles = classPathRegistry.getClassPath("ANT").getAsFiles();
Iterable<File> groovyFiles = Iterables.concat(spec.getGroovyClasspath(), antFiles);
JavaForkOptions javaForkOptions = new BaseForkOptionsConverter(fileResolver).transform(mergeForkOptions(javaOptions, groovyOptions));
File invocationWorkingDir = javaForkOptions.getWorkingDir();
javaForkOptions.setWorkingDir(daemonWorkingDir);
DaemonForkOptions daemonForkOptions = new DaemonForkOptionsBuilder(fileResolver).javaForkOptions(javaForkOptions).classpath(groovyFiles).sharedPackages(SHARED_PACKAGES).keepAliveMode(KeepAliveMode.SESSION).build();
return new InvocationContext(invocationWorkingDir, daemonForkOptions);
}
use of org.gradle.api.tasks.compile.GroovyForkOptions in project gradle by gradle.
the class DaemonGroovyCompiler method createGroovyForkOptions.
private DaemonForkOptions createGroovyForkOptions(GroovyJavaJointCompileSpec spec) {
GroovyForkOptions options = spec.getGroovyCompileOptions().getForkOptions();
// Ant is optional dependency of groovy(-all) module but mandatory dependency of Groovy compiler;
// that's why we add it here. The following assumes that any Groovy compiler version supported by Gradle
// is compatible with Gradle's current Ant version.
Collection<File> antFiles = classPathRegistry.getClassPath("ANT").getAsFiles();
Iterable<File> groovyFiles = Iterables.concat(spec.getGroovyClasspath(), antFiles);
return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs(), groovyFiles, SHARED_PACKAGES);
}
Aggregations