this.javaCompilerFactory = javaCompilerFactory;
this.compilerDaemonFactory = compilerDaemonFactory;
}
public Compiler<ScalaJavaJointCompileSpec> newCompiler(ScalaJavaJointCompileSpec spec) {
ScalaCompileOptions scalaOptions = spec.getScalaCompileOptions();
if (scalaOptions.isUseAnt()) {
Compiler<ScalaCompileSpec> scalaCompiler = new AntScalaCompiler(antBuilder);
Compiler<JavaCompileSpec> javaCompiler = javaCompilerFactory.createForJointCompilation(spec.getCompileOptions());
return new NormalizingScalaCompiler(new DefaultScalaJavaJointCompiler(scalaCompiler, javaCompiler));
}
if (!scalaOptions.isFork()) {
throw new GradleException("The Zinc based Scala compiler ('scalaCompileOptions.useAnt=false') "
+ "requires forking ('scalaCompileOptions.fork=true'), but the latter is set to 'false'.");
}
// currently, we leave it to ZincScalaCompiler to also compile the Java code