Class GradleEnterpriseBuildCache

    • Constructor Detail

      • GradleEnterpriseBuildCache

        public GradleEnterpriseBuildCache()
    • Method Detail

      • getServer

        @Nullable
        public String getServer()
        The address of the build cache server to use, if not using the built-in build cache of the server specified by GradleEnterpriseExtension.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(String)
      • setServer

        public void setServer​(@Nullable
                              String server)
        Sets the build cache server address to use, if not using the default build cache of the server specified by GradleEnterpriseExtension.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

        @Nullable
        public String getPath()
        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(String)
      • setPath

        public void setPath​(@Nullable
                            String path)
        Set a custom request path for the build cache server specified by getServer() or GradleEnterpriseExtension.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

        public boolean getAllowUntrustedServer()
        Whether it is acceptable to communicate with a build cache server with an untrusted SSL certificate.

        If GradleEnterpriseExtension.getAllowUntrustedServer() is true, untrusted connections will be allowed regardless of this setting.

        Returns:
        whether it is acceptable to communicate with a build scan server with an untrusted SSL certificate
      • setAllowUntrustedServer

        public void setAllowUntrustedServer​(boolean allowUntrustedServer)
        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).

        If GradleEnterpriseExtension.getAllowUntrustedServer() is true, untrusted connections will be allowed regardless of this setting.

        Parameters:
        allowUntrustedServer - whether to allow communication with an HTTPS server with an untrusted certificate
      • getAllowInsecureProtocol

        public boolean getAllowInsecureProtocol()
        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(boolean)
      • setAllowInsecureProtocol

        public void setAllowInsecureProtocol​(boolean allowInsecureProtocol)
        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

        public void usernameAndPassword​(String username,
                                        String password)
        Sets the username/password to use to authenticate with the build cache server.

        This is a convenient variant of setUsernameAndPassword(UsernameAndPassword).

        Parameters:
        username - the username
        password - the password
      • setUsernameAndPassword

        public void setUsernameAndPassword​(@Nullable
                                           GradleEnterpriseBuildCache.UsernameAndPassword usernameAndPassword)
        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