private Compiler<ScalaJavaJointCompileSpec> getCompiler(ScalaJavaJointCompileSpec spec) {
if (compiler == null) {
ProjectInternal projectInternal = (ProjectInternal) getProject();
IsolatedAntBuilder antBuilder = getServices().get(IsolatedAntBuilder.class);
CompilerDaemonFactory compilerDaemonFactory = getServices().get(CompilerDaemonManager.class);
JavaCompilerFactory javaCompilerFactory = getServices().get(JavaCompilerFactory.class);
ScalaCompilerFactory scalaCompilerFactory = new ScalaCompilerFactory(projectInternal, antBuilder, javaCompilerFactory, compilerDaemonFactory);
Compiler<ScalaJavaJointCompileSpec> delegatingCompiler = scalaCompilerFactory.newCompiler(spec);
compiler = new CleaningScalaCompiler(delegatingCompiler, getOutputs());
}