Closed WonderCsabo closed 8 years ago
Could you provide a sample, or even better write a functional test that is not working? I am currently working on an example project and it has been working fine.
I linked my example project in the OP. :wink:
You don't have gradle set to run the annotation processor.
androidGroovy {
options {
configure(groovyOptions) {
javaAnnotationProcessing = true
}
}
}
@pieces029 This does not help, and actually this is not necessary, because the android-apt
plugin already sets that property.
But i added that snippet and it is still not working. I reverted to Groovy Android Gradle Plugin 0.3.6 and Android Gradle Plugin 1.2.3, and the same project immediately worked, so i am pretty sure something went wrong in the newer plugin versions.
Here is what I'm doing for databinding, which uses annotation processing.
https://github.com/pieces029/groovy-android-data-binding/blob/master/build.gradle
The Apt Plugin didn't work until I set javaAnnotationProcessing = true
I don't think the skipJavaC is required, I just wanted groovy to compile everything.
I am currently working on a dagger sample, which does not use apt plugin and everything is also working fine, as long as I have javaAnnotationProcessing = true
.
This sounds more like a problem with the apt plugin if anything, although javaCompile is still finalized by groovy compile so that should all be working correctly too.
Oh, you need to have the groovy plugin before the apt plugin :)
Not sure why the order matters, but it does.
Opening as a ticket for adding documentation around annotation processing.
@pieces029 thanks, changing the plugin order indeed works!
Not sure why order matters, since android-apt
uses project.afterEvaluate()
. I guess Gradle will still order that call in some way.
Added in #115
I managed to make "annotation processing" work on a Groovy Android Gradle project.
I updated the Android Gradle Plugin from 1.2.3 to 1.5.0 and the Groovy Android Gradle plugin from 0.3.6 to 0.3.9, and annotation processing no longer works. The processor is initialised, but no processing rounds are started.
Issue originally opened against the android-apt plugin.