private Compiler<GroovyJavaJointCompileSpec> getCompiler(GroovyJavaJointCompileSpec spec) {
if (compiler == null) {
ProjectInternal projectInternal = (ProjectInternal) getProject();
CompilerDaemonManager compilerDaemonManager = getServices().get(CompilerDaemonManager.class);
InProcessCompilerDaemonFactory inProcessCompilerDaemonFactory = getServices().get(InProcessCompilerDaemonFactory.class);
JavaCompilerFactory javaCompilerFactory = getServices().get(JavaCompilerFactory.class);
GroovyCompilerFactory groovyCompilerFactory = new GroovyCompilerFactory(projectInternal, javaCompilerFactory, compilerDaemonManager, inProcessCompilerDaemonFactory);
Compiler<GroovyJavaJointCompileSpec> delegatingCompiler = groovyCompilerFactory.newCompiler(spec);
compiler = new CleaningGroovyCompiler(delegatingCompiler, getOutputs());
}