Buildless Extension API
This interface, along with nested types, defines the public API surface for the Buildless plugin for Gradle. Developers may customize their remote cache use via methods and fields defined herein.
While Buildless may be used directly as a drop-in Gradle remote cache, the plugin surfaces additional configuration and optimizations which are out-of-reach without custom code.
Using the plugin
To use Buildless from a Gradle build, the plugin must be applied at settings time, from settings.gradle.kts
(or the Groovy equivalent):
plugins {
id("build.less")
}
buildless {
// settings go here
}
The above is all that is needed in many cases to install and use Buildless as a remote cache. This loads the user's API key from any of the following sources:
Environment variables (
BUILDLESS_API_KEY
,GRADLE_CACHE_PASSWORD
)System properties (
buildless.apiKey
,cachePassword
)Local file (
.buildless.toml
,.github/buildless.toml
,.buildless/config.toml
,package.json:buildcache
)User-level configuration file (
~/.config/buildless.toml
,~/.buildless/config.toml
)
So long as an API key is present, the above settings.gradle.kts
code sample is sufficient to configure remote build caching within a Gradle build.
Applying Gradle cache settings
If the settings.gradle.kts
file where this plug-in is applied also performs its own configuration of Gradle's build cache, it will prevail over this plug-in and no action is taken.
If the developer wishes to configure Gradle's build caching features all in one go, they may do so via the local and remote cache settings provided by this plugin (i.e, no further configuration is required).
Parameters
Target type context within which this extension is used.
Settings context, within which plug-in configuration runs.
Inheritors
Types
Describes generic cache settings which apply to all types of caches; see LocalCacheSettings and RemoteCacheSettings for further information.
Properties
Specifies agent cache settings for this Gradle project. Agent caching keeps built outputs within a local cache service, like Buildless Agent. Agent caching is enabled by default if an API key is present in the local environment, using the main Gradle cache endpoint.
Specifies remote cache settings for this Gradle project. Remote caching keeps built outputs within a remote cache service, like Buildless. Remote caching is enabled by default if an API key is present in the local environment, using the main Gradle cache endpoint.
Specifies whether "debug mode" is active within the Buildless plugin. When debug mode is active, verbose logging is emitted to the terminal, and various trace values are sent to the Buildless API, which can be used to diagnose issues with the cache from the web dashboard.
Specifies local cache settings for this Gradle project. Local caching keeps various cached objects in a directory on-disk, and objects never leave the developer's machine. Local caching is enabled by default, and generally it is recommended to keep it active.
Alias for local cache settings.
Alias for cloud remote cache settings.
Specifies whether errors should be reported to the Buildless API. When error reporting is active, errors which are encountered when interacting with the cache are reported to a central service. These logs include only the authorization material provided by the developer, along with light context from the Gradle build.
Transport mechanism to use when interacting with the Buildless cache.