ForkOptions options = spec.getCompileOptions().getForkOptions();
return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(), options.getJvmArgs());
}
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);
List<String> groovyPackages = Arrays.asList("groovy", "org.codehaus.groovy", "groovyjarjarantlr", "groovyjarjarasm", "groovyjarjarcommonscli", "org.apache.tools.ant", "com.sun.tools.javac");
return new DaemonForkOptions(options.getMemoryInitialSize(), options.getMemoryMaximumSize(),
options.getJvmArgs(), groovyFiles, groovyPackages);
}