Skip to content

Gradle cache

NOT GENERALLY AVAILABLE

This feature is not generally available yet. If you are interested in trying it out, please reach out to us at [email protected].

Tuist provides a Gradle plugin that integrates with Gradle's built-in build cache to share build artifacts remotely. When a task's outputs are already cached, Gradle skips execution and pulls the result from Tuist's remote cache, saving build time across your team and CI environments.

REQUIREMENTS

The build cache is enabled by default once the Tuist Gradle plugin is installed. Gradle will use Tuist as a remote build cache, downloading cached task outputs on cache hits and uploading them after task execution.

Cache upload policy

By default, the plugin both downloads and uploads artifacts to the remote cache. You can control uploads with the push option in the buildCache block:

kotlin
tuist {
    buildCache {
        push = false // read-only mode
    }
}

A common pattern is to push artifacts only from CI, where builds are reproducible, while keeping local environments read-only:

kotlin
tuist {
    buildCache {
        push = System.getenv("CI") != null
    }
}

With this setup, local builds benefit from cached artifacts without uploading, while CI builds populate the cache for the rest of the team.

Continuous integration

For CI environments, authenticate using one of the methods in the Authentication guide. See the Continuous Integration guide for provider-specific CI examples.

Configuration reference

The buildCache block supports:

OptionTypeDefaultDescription
enabledBooleantrueWhether the remote build cache is enabled.
pushBooleantrueWhether to upload task outputs to the remote cache.
allowInsecureProtocolBooleanfalseWhether to allow insecure HTTP connections.

Released under the MIT License.