At the moment, the only reliable way to enable the Bitrise remote Gradle cache is using the predefined step.. If we dig under the hood, we see that this works by modifying the Gradle init script, via the bitrise-build-cache-cli.
In its current form, this breaks compatibility with Gradle configuration cache; configuration cache is never reusable over pipeline runs when the remote cache setup step is enabled. This is somewhat self-defeating for a cache feature; configuration caching can speed up builds almost as much as build caching, especially for large projects. (Some very smart folks suggest that we should strive to avoid using init scripts entirely - skip to 22:52 in the video.)
Ideally, users should be able to configure the Bitrise remote cache without using the init script mechanism. It’d be great if using the io.bitrise.gradle:remote-cache
package and configuring via the BitriseBuildCache
class in our own Gradle settings code was a supported and documented option.