So has anyone played around with `kapt { useBuildC...
# kapt
u
So has anyone played around with
kapt { useBuildCache = true }
? We're relying heavily on annotation processing and I think this could help speed up our build times significantly. However, I'm a bit afraid we'll end up with broken apps half the time...
4
y
@h0tk3y ^^ FYI
h
Well, caching kapt will work fine if the annotation processors that you use do not produce anything apart from Java/Kotlin sources and classes, all in the pre-defined directories (anything outside them won't be stored into the cache), and do not use anything other than the sources and the dependencies as inputs (we add Android layouts as the sources as well, it's fine for APs to use them). If you know about a particular annotation processor that uses or produces anything else, then make sure you add those things as inputs/oitputs to the kapt tasks with the Gradle's runtime inputs/outputs API, and again, that will work just fine. The annotation processors should be stable as well (i.e. produce the same outputs when called consecutively on the same inputs). I'd suggest trying to use the cache, clean the project and make Gradle load the results from cache to see how it works and whether it leads to the same build results (you may even compare the build results file-by-file).
u
sounds like a plan, thanks!