Search in sources :

Example 1 with PreviousCompilation

use of org.gradle.api.internal.tasks.compile.incremental.jar.PreviousCompilation in project gradle by gradle.

the class IncrementalCompilerDecorator method getCompiler.

private Compiler<JavaCompileSpec> getCompiler(IncrementalTaskInputs inputs, CompilationSourceDirs sourceDirs) {
    if (!inputs.isIncremental()) {
        LOG.info("{} - is not incremental (e.g. outputs have changed, no previous execution, etc.).", displayName);
        return cleaningCompiler;
    }
    if (!sourceDirs.canInferSourceRoots()) {
        LOG.info("{} - is not incremental. Unable to infer the source directories.", displayName);
        return cleaningCompiler;
    }
    List<AnnotationProcessorDeclaration> nonIncrementalProcessors = getNonIncrementalProcessors();
    if (!nonIncrementalProcessors.isEmpty()) {
        warnAboutNonIncrementalProcessors(nonIncrementalProcessors);
        return cleaningCompiler;
    }
    ClassSetAnalysisData data = compileCaches.getLocalClassSetAnalysisStore().get();
    if (data == null) {
        LOG.info("{} - is not incremental. No class analysis data available from the previous build.", displayName);
        return cleaningCompiler;
    }
    PreviousCompilation previousCompilation = new PreviousCompilation(new ClassSetAnalysis(data), compileCaches.getLocalJarClasspathSnapshotStore(), compileCaches.getJarSnapshotCache(), compileCaches.getAnnotationProcessorPathStore());
    return new SelectiveCompiler(inputs, previousCompilation, cleaningCompiler, staleClassDetecter, compilationInitializer, jarClasspathSnapshotMaker);
}
Also used : PreviousCompilation(org.gradle.api.internal.tasks.compile.incremental.jar.PreviousCompilation) ClassSetAnalysisData(org.gradle.api.internal.tasks.compile.incremental.deps.ClassSetAnalysisData) ClassSetAnalysis(org.gradle.api.internal.tasks.compile.incremental.deps.ClassSetAnalysis) AnnotationProcessorDeclaration(org.gradle.api.internal.tasks.compile.processing.AnnotationProcessorDeclaration)

Aggregations

ClassSetAnalysis (org.gradle.api.internal.tasks.compile.incremental.deps.ClassSetAnalysis)1 ClassSetAnalysisData (org.gradle.api.internal.tasks.compile.incremental.deps.ClassSetAnalysisData)1 PreviousCompilation (org.gradle.api.internal.tasks.compile.incremental.jar.PreviousCompilation)1 AnnotationProcessorDeclaration (org.gradle.api.internal.tasks.compile.processing.AnnotationProcessorDeclaration)1