private CleaningJavaCompiler createCompiler(JavaCompileSpec spec) {
// TODO:DAZ Supply the target platform to the task, using the compatibility flags as overrides
// Or maybe split the legacy compile task from the new one
Compiler<JavaCompileSpec> javaCompiler = ((JavaToolChainInternal) getToolChain()).select(getPlatform()).newCompiler(spec);
return new CleaningJavaCompiler(javaCompiler, getAntBuilderFactory(), getOutputs());
}