Android Integration #80
-
Hi, I am trying to integrate error prone into an Android SDK. Error prone don't have an official Gradle support and recommends this plugin instead. However, Android support is removed in 3.0+ according to the release notes. Release notes also states that the plugin should still be usable after a manual configuration of Java compile task. The closest thing I could find on how to do this is here #26 (comment). The solution provided works for me but I am a bit worried that the compiler argument (-XDcompilePolicy=simple) might cause issues at runtime and not sure if it is safe to use as is. I am trying to decide whether to proceed with the solution in the comment or not integrate error prone at all. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
From the README:
So you'd want to follow the “If you're creating custom compile tasks, then you'll have to configure them manually to enable Error Prone” instructions then, or equivalent (AGP creates its own JavaCompile tasks, unrelated to source sets, so considered "custom" here). That's what is meant by "manual configuration" in the 3.0 release notes. Wrt the Fwiw, the reason that Android support was removed from the plugin is that AGP actively makes it hard to configure tasks directly, and get the tasks associated with each variant. As I don't build for Android myself, and more and more Android projects use Kotlin anyway, trying to maintain that best-effort support wasn't a good use of my time. |
Beta Was this translation helpful? Give feedback.
From the README:
errorprone
, and configures the<sourceSet>AnnotationProcessor
configuration for each source set to extend it.” → the source sets with AGP aren't the same, so no configuration is configured to extend theerrorprone
configurationSo you'd want to follow the “If you're creating custom compile tasks, then you'll have to configure them manually to enable Error Prone” instructions then, or equivalent (AGP creates its own JavaCompile tasks, unrelated to source sets, so considered "custom" here). That's what is me…