1

I'm using gradle and I've written an annotation processor in the project itself and used @AutoService on it.

annotationProcessor 'com.google.auto.service:auto-service:1.0-rc5' compileOnly 'com.google.auto.service:auto-service:1.0-rc5' is in build.gradle file

I can see the generated javax.annotation.processing.Processor under build/classes/java/main/META-INF/services but the annotation processor does not execute. any ideas?

aminbhst
  • 75
  • 7
  • How do you know that it doesn't execute? To me, it looks like it's properly executed. – Olivier Grégoire Jul 02 '22 at 15:55
  • @OlivierGrégoire I create a new test file `new File("test.txt").createNewFile();` in the process method which is overridden from `AbstractProcessor` but the test file is never created – aminbhst Jul 02 '22 at 15:58
  • Which processor are you actually speaking about? AutoService or a custom one you made? – Olivier Grégoire Jul 02 '22 at 15:59
  • @OlivierGrégoire the custom one I made – aminbhst Jul 02 '22 at 16:00
  • 7
    "_in the project itself_" – Are you saying you wrote an annotation processor in the same project you want it to run for when you compile that project? Because that won't work. The annotation processor has to be compiled first. You'd have to separate out your annotation processor into a subproject, and then have your other subproject depend on it (e.g., `annotationProcessor project(':processor-subproject')`). – Slaw Jul 02 '22 at 16:17

0 Answers0