I’m attempting to write an annotation processor that will generate interfaces. It works when I build with gradle, but IDEA doesn’t see the generated classes until I build. And IDEA never shows any of the messages sent via messager
. What am I missing?
I threw my code up on github:
Setup:
- Checkout the annotation processor
- Install it locally:
./gradlew clean install
- Checkout the demo
- Open it in IDEA
- Note that the
IFoo
interface is not found on classBar
- Compile the demo:
./gradlew clean build
- Note that the
IFoo
interface is now found
Expectation:
I expected the annotation processor to be run in the background in IDEA, to generate the mythical “stubs” which Kapt supposedly produces, so that after annotating something, I can immediately go use it in my code, even before compiling. This should happen while editing. Things like messager
error messages which indicate you did something wrong (e.g. annotating an interface should produce an error in this case), never show up in IDEA.