/**
* Deletes stale classes before invoking the actual compiler
*/
public abstract class CleaningJavaCompilerSupport<T extends JavaCompileSpec> implements org.gradle.language.base.internal.compile.Compiler<T> {
public WorkResult execute(T spec) {
StaleClassCleaner cleaner = createCleaner(spec);
cleaner.setDestinationDir(spec.getDestinationDir());
cleaner.setSource(spec.getSource());
cleaner.execute();
Compiler<? super T> compiler = getCompiler();
return compiler.execute(spec);
}