Skip to content

Commit

Permalink
Merge pull request #1331 from gradle/gk/develocityMigration
Browse files Browse the repository at this point in the history
Migrated a gradle groovy sample to develocity plugin api
  • Loading branch information
ribafish authored Aug 9, 2024
2 parents 890e585 + 765a41d commit 09782f3
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 09782f3

Please sign in to comment.