I've been working on a simple java annotation processor that extends AbstractProcessor
.
I've been able to successfully test this using javac -Processor MyProcessor mySource.java
The problem is integrating this into a simple Hello World android application using Android Studio.
I started by making a new Android Project, and then adding a separate module where I place all my annotation processor code (the MyProcessor class as well as the custom annotation it uses).
I then added this new module as a dependency of the HelloWorld android project.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':MyProcessorModule')
}
How do I then use the processor to generate code based on all the source files in the HelloWorld application?