use of org.gradle.api.internal.tasks.compile.processing.AnnotationProcessorDeclaration in project gradle by gradle.
the class IncrementalAnnotationProcessingCompileTask method setupProcessors.
private void setupProcessors() {
processorClassloader = new URLClassLoader(DefaultClassPath.of(annotationProcessorPath).getAsURLArray());
List<Processor> processors = new ArrayList<Processor>(processorDeclarations.size());
for (AnnotationProcessorDeclaration declaredProcessor : processorDeclarations) {
try {
Class<?> processorClass = processorClassloader.loadClass(declaredProcessor.getClassName());
Processor processor = (Processor) processorClass.newInstance();
processor = decorateIfIncremental(processor, declaredProcessor.getType());
processors.add(processor);
} catch (Exception e) {
throw new IllegalArgumentException(e);
}
}
delegate.setProcessors(processors);
}
Aggregations