I thought I’d test the build cache on my Kotlin Android gradle project with Gradle 3.5 RC3. The project I’m working on has about 20 small modules relying on several variations of plugins: android, kotlin-android, and java. I was surprised at just how little was able to be cached. I ran ./gradlew clean assemble
twice, and here is the output after I ran it the second time:
1202 tasks in build, out of which 985 (82%) were executed
103 (9%) up-to-date
112 (9%) no-source
2 (0%) loaded from cache
985 (82%) not cacheable
With Android plugin 2.3, I was expecting a speedup for clean builds because of the android build cache, and surprisingly my team and I have noticed no difference. It appears we won’t notice much difference with Gradle 3.5 either.
What is causing our tasks not to be cacheable? Is it that Android just hasn’t implemented their build tasks in a way that satisfies the requirements of the Gradle 3.5 build cache yet?