Annotation processor is only generating files with build cache disabled

I have created a annotation processor that generates AsciiDoc files based on annotations. These files are written to build/generated/adoc.
When running gradle clean build, the annotation processor is not invoked when the build has run earlier. It only kicks in with gradle clean build --no-build-cache.

I guess Gradle does not know about the correct state of the generated files and assumes the files exist in the location.

I’m struggling with setting up the right behavour. Is the output supposed to go into a different directory?

Hi Martin,

I suppose you need to declare the outputs of your annotation processor on the JavaCompile task which generates them. Without declaring the outputs, Gradle won’t know if they are there or not.

I suppose you need to use the runtime API to declare the outputs on the tasks which run your annotation processor. You can see how to do this in the user manual.