gcp-gradle-build-cache icon indicating copy to clipboard operation
gcp-gradle-build-cache copied to clipboard

Enable Cloud Storage Prefix for Remote Build Cache

Open smrtfl opened this issue 6 months ago • 1 comments

Introduce support for specifying a custom prefix path when storing Gradle build cache entries in remote storage, such as GCS and AWS S3. By allowing a configurable prefix, users can better organize and isolate cache artifacts within a shared storage entity, facilitating multi-project setups and improving cache management.

Features

  • Configurable Prefix: Adds a new option to define a prefix path under which all cache entries will be stored in the remote storage.
  • Backward Compatibility: If no prefix is specified, the plugin retains its existing behavior, ensuring seamless integration with current configurations.

Example Usage

import androidx.build.gradle.s3buildcache.S3BuildCache
import androidx.build.gradle.s3buildcache.ExportedS3Credentials

plugins {
    id("androidx.build.gradle.s3buildcache")
}
            
buildCache {
    remote(S3BuildCache::class) {
        region = "foo"
        bucketName = "bar"
        prefix = "baz"
        credentials = ExportedS3Credentials("key-id", "secret-key")
    }
}

smrtfl avatar May 16 '25 07:05 smrtfl

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar May 16 '25 07:05 google-cla[bot]