Reputation: 452
I am developing an annotation processor and now I doing next steps for testing:
repositories {
maven { url 'https://jitpack.io' }
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
compileOnly 'com.github.hohserg1:MyAnnotationProcessor:main-SNAPSHOT'
}
It very terrible. How to reduce it to "press run button"?
Upvotes: 0
Views: 379
Reputation: 1054
You would need your processor, your annotation, and the application to be each in a different module is a different dependency, you do this to avoid cyclic dependency between the processor and the application, and also help you to avoid including the processor classes in your application artifacts.
also, note that when you develop an annotation processor you don't test the processor itself but you test the code generated from that processor if the generated code works then the processor is also working as expected.
Upvotes: 1