nsc cache gradle setup

Set up a remote Gradle build cache.

Namespace provides high-performance Gradle build caching with very low network latency between runners and the cache storage. This allows your Gradle workflows to reuse build outputs across runs, significantly reducing build times. cache gradle setup sets up a remote Gradle build cache and generates an init script to use it.

Learn more about Gradle caching →

Usage

nsc cache gradle setup [--cache_name <name>] \
    [--init-gradle <path>] \
    [--output <plain|json>] \
    [--push] \
    [--site <site>] \
    [--token <path>] \
    [--user]

Example

The following example creates a remote Gradle build cache and uses it during a build invocation.

$ nsc cache gradle setup --init-gradle=/tmp/init.gradle

Next, let's use the generated configuration

$ gradle --init-script=/tmp/init.gradle build

Options

--cache_name

A name for the cache. Defaults to default.

--init-gradle

If specified, write the init script to this path.

-o, --output

Output format, one of plain or json. Defaults to plain.

--push

Whether to enable pushing to the cache. Defaults to true.

--site

Site preference (e.g. iad, fra). If not set, determined automatically.

--token

Path to a token file for long-term access (e.g. from local workstations). If not specified, short-term credentials are generated.

--user

If specified, write the configuration to the Gradle user home directory.

Last updated