How to deeply locate the problem of Annotation Processor processor
In view of how to locate the problem of Annotation Processor processor in depth, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
What is the Annotation Processor build problem
At first glance, veteran drivers who have written custom annotation processors feel that this problem is quite simple, yes, because the whole article on the Internet is basically teaching you how to log, but have you ever thought about how to locate if you can't even print the log? For example, the following code:
/ / confirm that META-INF/services/javax.annotation.processing.Processor is fine / / confirm that the build script is fine, and confirm that the annotation Bridge is used and participated in the construction of @ AutoService (Processor.class) public class TestAnnotationProcessor extends AbstractProcessor {public TestAnnotationProcessor () {System.out.println ("TestAnnotationProcessor constrator");} @ Override public synchronized void init (ProcessingEnvironment processingEnvironment) {super.init (processingEnvironment) System.out.println ("TestAnnotationProcessor init");} @ Override public Set getSupportedAnnotationTypes () {System.out.println ("TestAnnotationProcessor getSupportedAnnotationTypes"); Set supported = new HashSet (); supported.add (Bridge.class.getCanonicalName ()); return supported;} @ Override public boolean process (Set)