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

Migrated a gradle groovy sample to develocity plugin api #1331

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.gradle.scan.plugin.BuildScanExtension
import com.gradle.develocity.agent.gradle.scan.BuildScanConfiguration
import org.gradle.util.internal.VersionNumber
import java.nio.charset.StandardCharsets
import java.util.Collections
Expand All @@ -12,11 +12,11 @@ import java.util.stream.Collectors
* adding a flag as custom value.
*/

def buildScanApi = project.extensions.findByName('buildScan')
if (!buildScanApi) {
def develocityApi = project.extensions.findByName('develocity')
if (!develocityApi) {
return
}
def capture = new Capture(buildScanApi, gradle.rootProject.logger)
def capture = new Capture(develocityApi.getBuildScan(), gradle.rootProject.logger)
allprojects {
tasks.withType(Test).configureEach { t ->
doFirst {
Expand All @@ -38,9 +38,9 @@ class Capture {
'io.cucumber.junit.platform.engine.CucumberTestEngine' : 'cucumber-junit-platform'
]
private Logger logger
private BuildScanExtension buildScanApi
private BuildScanConfiguration buildScanApi

Capture(BuildScanExtension buildScanApi, Logger logger) {
Capture(BuildScanConfiguration buildScanApi, Logger logger) {
this.buildScanApi = buildScanApi
this.logger = logger
}
Expand Down