use of org.gradle.api.internal.tasks.compile.incremental.processing.AnnotationProcessingResult in project gradle by gradle.
the class ClassSetAnalysisUpdater method visitAnnotationProcessingResult.
private void visitAnnotationProcessingResult(JavaCompileSpec spec, WorkResult result, CompilationResultAnalyzer analyzer) {
if (!spec.getEffectiveAnnotationProcessors().isEmpty()) {
AnnotationProcessingResult annotationProcessingResult = null;
if (result instanceof JdkJavaCompilerResult) {
annotationProcessingResult = ((JdkJavaCompilerResult) result).getAnnotationProcessingResult();
}
analyzer.visitAnnotationProcessingResult(annotationProcessingResult);
}
}
use of org.gradle.api.internal.tasks.compile.incremental.processing.AnnotationProcessingResult in project gradle by gradle.
the class IncrementalResultStoringCompiler method getAnnotationProcessingData.
private AnnotationProcessingData getAnnotationProcessingData(JavaCompileSpec spec, WorkResult result) {
Set<AnnotationProcessorDeclaration> processors = spec.getEffectiveAnnotationProcessors();
if (processors.isEmpty()) {
return new AnnotationProcessingData();
}
AnnotationProcessingData previousAnnotationProcessingData = null;
RecompilationSpec recompilationSpec = null;
if (result instanceof IncrementalCompilationResult) {
previousAnnotationProcessingData = ((IncrementalCompilationResult) result).getPreviousCompilationData().getAnnotationProcessingData();
recompilationSpec = ((IncrementalCompilationResult) result).getRecompilationSpec();
result = ((IncrementalCompilationResult) result).getCompilerResult();
}
Set<String> changedClasses = recompilationSpec == null ? Collections.emptySet() : recompilationSpec.getClassesToCompile();
if (result instanceof ApiCompilerResult) {
AnnotationProcessingResult processingResult = ((ApiCompilerResult) result).getAnnotationProcessingResult();
AnnotationProcessingData newAnnotationProcessingData = new AnnotationProcessingData(processingResult.getGeneratedTypesWithIsolatedOrigin(), processingResult.getAggregatedTypes(), processingResult.getGeneratedAggregatingTypes(), processingResult.getGeneratedResourcesWithIsolatedOrigin(), processingResult.getGeneratedAggregatingResources(), processingResult.getFullRebuildCause());
if (previousAnnotationProcessingData == null) {
return newAnnotationProcessingData;
}
return mergeAnnotationProcessingData(previousAnnotationProcessingData, newAnnotationProcessingData, changedClasses);
}
return new AnnotationProcessingData(ImmutableMap.of(), ImmutableSet.of(), ImmutableSet.of(), ImmutableMap.of(), ImmutableSet.of(), "the chosen compiler did not support incremental annotation processing");
}
Aggregations