Class GradleEnterpriseBuildCache
- All Implemented Interfaces:
BuildCache
This can be used with BuildCacheConfiguration.remote(Class, Action)
to enable
use of the Gradle Enterprise remote build caching.
The method GradleEnterpriseExtension.getBuildCache()
must be used to obtain the type object to use.
This type cannot be used directly.
The following example demonstrates usage in a build's settings script:
buildCache {
remote(gradleEnterprise.buildCache) {
// configure
}
}
Without any explicit configuration, the default build cache provided by the installation specified by
GradleEnterpriseExtension.getServer()
will be used.
If an access key is available for the GradleEnterpriseExtension.getServer()
value it will be used to authenticate with the build cache.
- Since:
- 3.11
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Deprecated.since 3.17, replaced byDevelocityBuildCache.UsernameAndPassword
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Whether the use of plain/unencrypted HTTP is allowed when communicating with the build cache server.Deprecated.Whether it is acceptable to communicate with a build cache server with an untrusted SSL certificate.getPath()
Deprecated.The custom request path for the build cache server.Deprecated.The address of the build cache server to use, if not using the built-in build cache of the server specified byGradleEnterpriseExtension.getServer()
.boolean
Deprecated.Whether to use HTTP Expect-Continue when storing data on the build cache server.Deprecated.The username/password to use to authenticate with the build cache server.void
setAllowInsecureProtocol
(boolean allowInsecureProtocol) Deprecated.Sets whether the use of plain/unencrypted HTTP is allowed when communicating with the build cache server.void
setAllowUntrustedServer
(boolean allowUntrustedServer) Deprecated.Specifies whether it is acceptable to communicate with the build cache server using an untrusted SSL certificate.void
Deprecated.Set a custom request path for the build cache server specified bygetServer()
orGradleEnterpriseExtension.getServer()
.void
Deprecated.Sets the build cache server address to use, if not using the default build cache of the server specified byGradleEnterpriseExtension.getServer()
.void
setUseExpectContinue
(boolean useExpectContinue) Deprecated.Sets whether to use HTTP Expect-Continue when storing data on the build cache server.void
setUsernameAndPassword
(GradleEnterpriseBuildCache.UsernameAndPassword usernameAndPassword) Deprecated.Sets the username/password to use to authenticate with the build cache server.void
usernameAndPassword
(String username, String password) Deprecated.Sets the username/password to use to authenticate with the build cache server.Methods inherited from class org.gradle.caching.configuration.AbstractBuildCache
isEnabled, isPush, setEnabled, setPush
-
Constructor Details
-
GradleEnterpriseBuildCache
public GradleEnterpriseBuildCache()Deprecated.
-
-
Method Details
-
getServer
Deprecated.The address of the build cache server to use, if not using the built-in build cache of the server specified byGradleEnterpriseExtension.getServer()
.- Returns:
null
if the built-in build cache of the Gradle Enterprise server should be used, or the address of the build cache server that should be used- See Also:
-
setServer
Deprecated.Sets the build cache server address to use, if not using the default build cache of the server specified byGradleEnterpriseExtension.getServer()
.Setting this option is necessary when using a dedicated build cache node instead of the Gradle Enterprise built-in build cache.
The value set must not include any request path or query string. It must only specify the protocol, hostname and port.
If an access key is available for the
GradleEnterpriseExtension.getServer()
value it will be used to authenticate with the build cache, regardless of the build cache server address set with this method.- Parameters:
server
- the server address
-
getPath
Deprecated.The custom request path for the build cache server.It is generally not necessary to set this value, as the default value used is suitable for the default configuration of Gradle Enterprise build cache nodes (including the built-in build cache).
- Returns:
- the custom request path for the build cache server
- See Also:
-
setPath
Deprecated.Set a custom request path for the build cache server specified bygetServer()
orGradleEnterpriseExtension.getServer()
.It is generally not necessary to set this value, as the default value used is suitable for the default configuration of Gradle Enterprise build cache nodes (including the built-in build cache).
- Parameters:
path
- a custom request path for the build cache server
-
getAllowUntrustedServer
Deprecated.Whether it is acceptable to communicate with a build cache server with an untrusted SSL certificate.If not set then will be inherited from
GradleEnterpriseExtension.getAllowUntrustedServer()
.- Returns:
null
if the value should be inherited fromGradleEnterpriseExtension.getAllowUntrustedServer()
, or whether it is acceptable to communicate with a build scan server with an untrusted SSL certificate- See Also:
-
setAllowUntrustedServer
public void setAllowUntrustedServer(boolean allowUntrustedServer) Deprecated.Specifies whether it is acceptable to communicate with the build cache server using an untrusted SSL certificate.If the build cache server are uses an internally provisioned or self-signed certificate it will not be trusted by default. Allowing communication with untrusted servers keeps data encrypted during transmission, but makes it easy for a man-in-the-middle to impersonate the intended server and capture data.
In such a scenario, you can either configure the build JVM environment to trust the certificate, or call this method with
true
to disable verification of the server's identity.This value has no effect if communicating with the server using the HTTP protocol (i.e. has SSL disabled).
- Parameters:
allowUntrustedServer
- whether to allow communication with an HTTPS server with an untrusted certificate
-
getAllowInsecureProtocol
public boolean getAllowInsecureProtocol()Deprecated.Whether the use of plain/unencrypted HTTP is allowed when communicating with the build cache server.- Returns:
- whether the use of plain/unencrypted HTTP is allowed when communicating with the build cache server
- See Also:
-
setAllowInsecureProtocol
public void setAllowInsecureProtocol(boolean allowInsecureProtocol) Deprecated.Sets whether the use of plain/unencrypted HTTP is allowed when communicating with the build cache server.This value defaults to
false
.Use of unencrypted HTTP allows interception of build cache entries while in transit and is a significant privacy risk. Use of HTTPS instead of enabling this setting is strongly recommended
- Parameters:
allowInsecureProtocol
- whether to allow the use of plain/unencrypted HTTP
-
usernameAndPassword
Deprecated.Sets the username/password to use to authenticate with the build cache server.This is a convenient variant of
setUsernameAndPassword(UsernameAndPassword)
.- Parameters:
username
- the usernamepassword
- the password
-
setUsernameAndPassword
public void setUsernameAndPassword(@Nullable GradleEnterpriseBuildCache.UsernameAndPassword usernameAndPassword) Deprecated.Sets the username/password to use to authenticate with the build cache server.If specified, the username/password will be used instead of any available Gradle Enterprise access key. Use of access keys should be preferred.
- Parameters:
usernameAndPassword
- the username and password
-
getUsernameAndPassword
Deprecated.The username/password to use to authenticate with the build cache server.- Returns:
- the username/password to use to authenticate with the build cache server
- See Also:
-
getUseExpectContinue
public boolean getUseExpectContinue()Deprecated.Whether to use HTTP Expect-Continue when storing data on the build cache server.- Returns:
- whether the use of HTTP Expect-Continue is configured when communicating with the build cache server
- Since:
- 3.12
- See Also:
-
setUseExpectContinue
public void setUseExpectContinue(boolean useExpectContinue) Deprecated.Sets whether to use HTTP Expect-Continue when storing data on the build cache server.This causes PUT requests to happen in two parts: first a check whether a body would be accepted, then transmission of the body if the server indicates it will accept it. This is particularly suitable for Build Cache servers that routinely redirect or reject PUT requests, as it avoids transmitting the cache entry just to have it rejected. This additional check incurs extra latency when the server accepts the request, but reduces latency when the request is rejected or redirected.
This value defaults to
false
.While the Gradle Enterprise Build Cache Node supports Expect-Continue, not all HTTP servers and proxies reliably do. Be sure to check that your Build Cache server does support it before enabling.
- Parameters:
useExpectContinue
- whether to use HTTP Expect-Continue- Since:
- 3.12
-
DevelocityBuildCache