Search in sources :

Example 1 with SupportedOptionsCollectingProcessor

use of org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor in project gradle by gradle.

the class AnnotationProcessingCompileTask method setupProcessors.

private void setupProcessors() {
    processorClassloader = createProcessorClassLoader();
    List<Processor> processors = new ArrayList<Processor>(processorDeclarations.size());
    if (!processorDeclarations.isEmpty()) {
        SupportedOptionsCollectingProcessor supportedOptionsCollectingProcessor = new SupportedOptionsCollectingProcessor();
        for (AnnotationProcessorDeclaration declaredProcessor : processorDeclarations) {
            AnnotationProcessorResult processorResult = new AnnotationProcessorResult(result, declaredProcessor.getClassName());
            result.getAnnotationProcessorResults().add(processorResult);
            Class<?> processorClass = loadProcessor(declaredProcessor);
            Processor processor = instantiateProcessor(processorClass);
            supportedOptionsCollectingProcessor.addProcessor(processor);
            processor = decorateForIncrementalProcessing(processor, declaredProcessor.getType(), processorResult);
            processor = decorateForTimeTracking(processor, processorResult);
            processors.add(processor);
        }
        processors.add(supportedOptionsCollectingProcessor);
    }
    delegate.setProcessors(processors);
}
Also used : SupportedOptionsCollectingProcessor(org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor) SupportedOptionsCollectingProcessor(org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor) TimeTrackingProcessor(org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor) NonIncrementalProcessor(org.gradle.api.internal.tasks.compile.processing.NonIncrementalProcessor) IsolatingProcessor(org.gradle.api.internal.tasks.compile.processing.IsolatingProcessor) Processor(javax.annotation.processing.Processor) AggregatingProcessor(org.gradle.api.internal.tasks.compile.processing.AggregatingProcessor) DynamicProcessor(org.gradle.api.internal.tasks.compile.processing.DynamicProcessor) AnnotationProcessorResult(org.gradle.api.internal.tasks.compile.incremental.processing.AnnotationProcessorResult) ArrayList(java.util.ArrayList) AnnotationProcessorDeclaration(org.gradle.api.internal.tasks.compile.processing.AnnotationProcessorDeclaration)

Aggregations

ArrayList (java.util.ArrayList)1 Processor (javax.annotation.processing.Processor)1 AnnotationProcessorResult (org.gradle.api.internal.tasks.compile.incremental.processing.AnnotationProcessorResult)1 AggregatingProcessor (org.gradle.api.internal.tasks.compile.processing.AggregatingProcessor)1 AnnotationProcessorDeclaration (org.gradle.api.internal.tasks.compile.processing.AnnotationProcessorDeclaration)1 DynamicProcessor (org.gradle.api.internal.tasks.compile.processing.DynamicProcessor)1 IsolatingProcessor (org.gradle.api.internal.tasks.compile.processing.IsolatingProcessor)1 NonIncrementalProcessor (org.gradle.api.internal.tasks.compile.processing.NonIncrementalProcessor)1 SupportedOptionsCollectingProcessor (org.gradle.api.internal.tasks.compile.processing.SupportedOptionsCollectingProcessor)1 TimeTrackingProcessor (org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor)1