Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add samples capturing maxParallelForks as a custom value #909

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build-data-capturing-gradle-samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ _Demonstrates: Custom links_
This sample creates a private GitHub gist containing the difference between the current working directory and the index.
The URL of the gist is included as a custom link named `Git diff` at the top of the Build Scan.

### Capture maxParallelForks

_Demonstrates: Custom values_

This sample captures the value of `maxParallelForks` for each test task and adds it to the Build Scan as a custom value.

### Capture OS Processes

_Demonstrates: Custom values_
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def buildScan = project.extensions.findByName('buildScan')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this check in the kotlin version?

if (!buildScan) {
return
}

allprojects {
tasks.withType(Test).configureEach {
buildScan.value "${identityPath}#maxParallelForks", "${maxParallelForks}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension

project.extensions.configure<GradleEnterpriseExtension>() {
buildScan {
allprojects {
tasks.withType<Test>().configureEach {
value("${identityPath}#maxParallelForks", "$maxParallelForks")
}
}
}
}