Interface BuildScanConfiguration
- Since:
- 3.17
-
Method Summary
Modifier and TypeMethodDescriptionvoid
background
(Action<? super BuildScanConfiguration> action) Executes the given action in a background thread, allowing the current Gradle work to continue.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.void
buildScanPublished
(Action<? super PublishedBuildScan> action) Registers a callback that is invoked when a build scan has been published successfully.void
capture
(Action<? super BuildScanCaptureConfiguration> action) Allows configuring what data will be captured as part of the build scan.Allows configuring what data will be captured as part of the build scan.Allows registering functions for obfuscating certain identifying information within build scans.Allows configuring when a build scan should be published at the end of the build.The agreement of the Gradle Terms of Use.The location of the Gradle Terms of Use that are agreed to when creating a build scan.Specifies whether to upload the build scan in background after the build has finished.void
Captures a named link for the current build.void
obfuscation
(Action<? super BuildScanDataObfuscationConfiguration> action) Allows registering functions for obfuscating certain identifying information within build scans.void
publishing
(Action<? super BuildScanPublishingConfiguration> action) Allows configuring when a build scan should be published at the end of the build.void
Captures a tag for the current build.void
Captures a named value for the current build.
-
Method Details
-
background
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
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
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 nullvalue
- the value, may be null
-
link
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 nullurl
- the url, must not be null
-
buildFinished
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
Registers a callback that is invoked when a build scan has been published successfully.If
getUploadInBackground()
istrue
, 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
The location of the Gradle Terms of Use that are agreed to when creating a build scan. -
getTermsOfUseAgree
The agreement of the Gradle Terms of Use. -
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
-
publishing
Allows configuring when a build scan should be published at the end of the build. -
getObfuscation
BuildScanDataObfuscationConfiguration getObfuscation()Allows registering functions for obfuscating certain identifying information within build scans.- Returns:
- the register of obfuscation functions
-
obfuscation
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
Allows configuring what data will be captured as part of the build scan.- Parameters:
action
- a function to be applied to the capture settings
-