A custom Gradle Build Cache implementation which uses Google Cloud Storage to store the cacheable artifacts.
Haven't heard about Gradle's Build Cache yet?
In a nutshell the generated output of a Task will cached (either local or remote)
and can be reused the next time you build your software. Event on clean
builds.
The GCSCache will exactly do that for you. It will store the generated artifacts in your Google Cloud Storage which can be reused the next time you do a build.
To apply the plugin just put the following to the top of your settings.gradle
:
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" } // TODO: Check if gradlePluginPortal() is possible
// or
jcenter()
}
dependencies {
classpath "" // TODO: Define classpath
}
}
Just go to your settings.gradle
and use the following code:
apply plugin: guru.stefma.gcs.cache.GCSCachePlugin // TODO: Use plugin in
buildCache {
remote(guru.stefma.gcs.cache.GCSBuildCache) {
push = true
}
}
This will enable the GCSCache and enable the push (so that it will upload the artifacts as well).
Other configuration options are:
Property | Description | Mandatory | Default Value |
---|---|---|---|
enabled |
If the remote Build Cache is enabled | ❌ | true |
push |
If artifacts should be pushed/uploaded to the cloud | ❌ | false |
Since the plugin needs to authenticate you with your Google Cloud you have to follow these steps to authenticate.