Interface GradleEnterpriseExtension


  • @NonExtensible
    public interface GradleEnterpriseExtension
    The DSL extension for configuring Gradle Enterprise, with the name "gradleEnterprise".
    
     gradleEnterprise {
       // Gradle Enterprise configuration
     }
     
    Since:
    3.0
    • Field Detail

      • NAME

        static final String NAME
        The name of the extension added to the root project (for Gradle 5.x) or settings (for Gradle 6.0 and later).
        See Also:
        Constant Field Values
    • Method Detail

      • getBuildScan

        BuildScanExtension getBuildScan()
        The build scan extension.
        Returns:
        the build scan extension
      • buildScan

        void buildScan​(Action<? super BuildScanExtension> action)
        Configures the build scan extension.
        Parameters:
        action - the configuration action
      • setServer

        void setServer​(String server)
        Sets the URL of the Gradle Enterprise server.
        Parameters:
        server - the server URL
        Since:
        3.2
      • getServer

        @Nullable
        String getServer()
        Returns the URL of the Gradle Enterprise server.
        Returns:
        null when no Gradle Enterprise server is configured
        Since:
        3.2
      • setAllowUntrustedServer

        void setAllowUntrustedServer​(boolean allow)
        Specifies whether it is acceptable to communicate with a Gradle Enterprise server using an untrusted SSL certificate.

        The default (public) build scan server uses SSL certificates that are trusted by default by standard modern Java environments. If you are using a different build scan server via Gradle Enterprise, it may use an untrusted certificate. This may be due to the use of an internally provisioned or self-signed certificate.

        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. Alternatively, you may disable SSL completely for Gradle Enterprise installation but this is not recommended.

        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.

        This value has no effect if a server is specified using the HTTP protocol (i.e. has SSL disabled).

        Parameters:
        allow - whether to allow communication with a HTTPS server with an untrusted certificate
        Since:
        3.2
      • getAllowUntrustedServer

        boolean getAllowUntrustedServer()
        Whether it is acceptable to communicate with a build scan server with an untrusted SSL certificate.
        Returns:
        true it is acceptable to communicate with a build scan server with an untrusted SSL certificate
        Since:
        3.2
      • setAccessKey

        void setAccessKey​(String accessKey)
        Sets the access key for authenticating with the Gradle Enterprise server.

        An access key configured this way will take precedence over the GRADLE_ENTERPRISE_ACCESS_KEY environment variable or access key file entry associated with the server.

        Parameters:
        accessKey - a Gradle Enterprise server access key without any hostname prefix
        Since:
        3.7
      • getAccessKey

        @Nullable
        String getAccessKey()
        Returns the access key for authenticating with the Gradle Enterprise server.

        Only the value of the explicitly configured access key (via setAccessKey(String)) is returned but not the value of an access key configured via the GRADLE_ENTERPRISE_ACCESS_KEY environment variable or access key file entry.

        Returns:
        the configured Gradle Enterprise server access key, if available; otherwise, null
        Since:
        3.7
      • getBuildCache

        Class<? extends GradleEnterpriseBuildCache> getBuildCache()
        The type to be used for registering the Gradle Enterprise build cache with Gradle.

        This should be used with BuildCacheConfiguration.remote(Class, Action) to enable use of the Gradle Enterprise remote build caching.

        The following example demonstrates usage in a build's settings script:

        
         buildCache {
           remote(gradleEnterprise.buildCache) {
             // configure
           }
         }
         
        Returns:
        the type to be used for registering the Gradle Enterprise build cache with Gradle
        Since:
        3.11
        See Also:
        GradleEnterpriseBuildCache