Interface BuildScanConfiguration


  • public interface BuildScanConfiguration
    The configuration for Build Scan publication.
    Since:
    3.17
    • Method Detail

      • background

        void background​(Action<? super BuildScanConfiguration> action)
        Executes the given action in a background thread, allowing the current Gradle work to continue.

        This method is useful for capturing values, tags and links that are expensive to compute. By capturing them in the background, Gradle can continue doing other work, making your build faster.

        For example, if you are capturing the Git commit ID as a custom value you should invoke Git in the background:

         develocity.buildScan.background {
           def commitId = 'git rev-parse --verify HEAD'.execute().text.trim()
           value "Git Commit ID", commitId
         }
         

        All background work will be completed before finishing the build and publishing the build scan.

        Any errors that are thrown by the background action will be logged and captured in the build scan.

        Parameters:
        action - the action to execute in the background
      • tag

        void tag​(java.lang.String tag)
        Captures a tag for the current build. The tag is not required to be unique for a given build.
        Parameters:
        tag - the name of the tag, must not be null
      • value

        void value​(java.lang.String name,
                   java.lang.String value)
        Captures a named value for the current build. The name is not required to be unique for a given build.
        Parameters:
        name - the name, must not be null
        value - the value, may be null
      • link

        void link​(java.lang.String name,
                  java.lang.String url)
        Captures a named link for the current build. The name is not required to be unique for a given build.
        Parameters:
        name - the name, must not be null
        url - the url, must not be null
      • buildFinished

        void buildFinished​(Action<? super BuildResult> action)
        Registers a callback that is invoked when the build has finished, but before this extension stops accepting to be called.
        Parameters:
        action - the action to execute when the build has finished
      • buildScanPublished

        void buildScanPublished​(Action<? super PublishedBuildScan> action)
        Registers a callback that is invoked when a build scan has been published successfully.

        If getUploadInBackground() is true, the callback is executed before the build scan is uploaded. If the build scan is accessed immediately, it may not be available yet as it is still being uploaded to the server.

        Parameters:
        action - the action to execute when the build scan has been published successfully
      • getTermsOfUseUrl

        Property<java.lang.String> getTermsOfUseUrl()
        The location of the Gradle Terms of Use that are agreed to when creating a build scan.
      • getTermsOfUseAgree

        Property<java.lang.String> getTermsOfUseAgree()
        The agreement of the Gradle Terms of Use.
      • getUploadInBackground

        Property<java.lang.Boolean> getUploadInBackground()
        Specifies whether to upload the build scan in background after the build has finished.

        Defaults to true.

        This allows the build to finish sooner, but can be problematic in build environments that terminate as soon as the build is finished as the upload may be terminated before it completes. Background uploading should be disabled for such environments.

        This setting can also be set by the scan.uploadInBackground system property, which, if set, takes precedence over any value set by this method and the default.

      • getPublishing

        BuildScanPublishingConfiguration getPublishing()
        Allows configuring when a build scan should be published at the end of the build.
        Returns:
        the publishing configuration
      • getObfuscation

        BuildScanDataObfuscationConfiguration getObfuscation()
        Allows registering functions for obfuscating certain identifying information within build scans.
        Returns:
        the register of obfuscation functions
      • obfuscation

        void obfuscation​(Action<? super BuildScanDataObfuscationConfiguration> action)
        Allows registering functions for obfuscating certain identifying information within build scans.
        Parameters:
        action - a function to be applied to the register of obfuscation functions
      • getCapture

        BuildScanCaptureConfiguration getCapture()
        Allows configuring what data will be captured as part of the build scan.
        Returns:
        the capture configuration
      • capture

        void capture​(Action<? super BuildScanCaptureConfiguration> action)
        Allows configuring what data will be captured as part of the build scan.
        Parameters:
        action - a function to be applied to the capture settings