Gradle 3.5-rc-3 Build Cache

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?

That’s right @Scott_Pierce, we’re working with the Android team to make as many tasks as possible cacheable by their release of the Android Gradle Plugin 2.5.

@eljobe Thanks for the information. I look forward to that.

Out of curiosity, will the gradle cache deprecate the Android build cache added in Android 2.3, or will they accomplish different things?

I expect they’ll remain different things for the short/medium term.