From d1b028ef8a3b9f0f81c7afa35aa8cdd3d35587e9 Mon Sep 17 00:00:00 2001 From: Gasper Kojek Date: Wed, 7 Aug 2024 12:06:17 +0200 Subject: [PATCH 1/2] Migrated a groovy sample to develocity plugin api --- .../gradle-test-pts-support.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle b/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle index 3d608c533..07908c142 100644 --- a/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle +++ b/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle @@ -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 @@ -12,7 +12,7 @@ import java.util.stream.Collectors * adding a flag as custom value. */ -def buildScanApi = project.extensions.findByName('buildScan') +def buildScanApi = project.extensions.findByName('develocity').getBuildScan(); if (!buildScanApi) { return } @@ -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 } From 765a41d552559bed0a9efb73af5e6ed173dcfa34 Mon Sep 17 00:00:00 2001 From: Gasper Kojek Date: Thu, 8 Aug 2024 10:50:55 +0200 Subject: [PATCH 2/2] Fixed capture pts support groovy sample --- .../capture-test-pts-support/gradle-test-pts-support.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle b/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle index 07908c142..a5515f93c 100644 --- a/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle +++ b/build-data-capturing-gradle-samples/capture-test-pts-support/gradle-test-pts-support.gradle @@ -12,11 +12,11 @@ import java.util.stream.Collectors * adding a flag as custom value. */ -def buildScanApi = project.extensions.findByName('develocity').getBuildScan(); -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 {