From 542ebe8d91ad6a56cd5cb14da89fef53a161ad19 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Thu, 22 Feb 2024 11:47:52 +0100 Subject: [PATCH] Upgrade to Gradle 8.4 --- sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt | 3 --- .../test/kotlin/com/bakdata/gradle/SonarPluginTest.kt | 9 +-------- .../test/kotlin/com/bakdata/gradle/SonatypePluginTest.kt | 9 +-------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt b/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt index 8916332..a191024 100644 --- a/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt +++ b/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt @@ -24,8 +24,6 @@ package com.bakdata.gradle -//import org.gradle.testing.jacoco.tasks.JacocoMerge - import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project @@ -35,7 +33,6 @@ import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.* import org.gradle.testing.jacoco.plugins.JacocoPluginExtension -import org.gradle.testing.jacoco.tasks.JacocoMerge import org.gradle.testing.jacoco.tasks.JacocoReport class SonarPlugin : Plugin { diff --git a/sonar/src/test/kotlin/com/bakdata/gradle/SonarPluginTest.kt b/sonar/src/test/kotlin/com/bakdata/gradle/SonarPluginTest.kt index ae32d3c..20f046e 100644 --- a/sonar/src/test/kotlin/com/bakdata/gradle/SonarPluginTest.kt +++ b/sonar/src/test/kotlin/com/bakdata/gradle/SonarPluginTest.kt @@ -38,8 +38,6 @@ import org.junit.jupiter.api.Test internal class SonarPluginTest { fun taskWithName(name: String): Condition = Condition({ it.name == name }, "Task with name $name") - fun causeWithMessage(message: String): Condition = Condition({ it.cause?.message?.contains(message) ?: false }, "Cause with message $message") - fun Project.evaluate() { (this as DefaultProject).evaluate() } @@ -139,12 +137,7 @@ internal class SonarPluginTest { val parent = ProjectBuilder.builder().withName("parent").build() val child1 = ProjectBuilder.builder().withName("child1").withParent(parent).build() - // Error message is thrown when passing as Consumer to satisfies - // If original type is SAM type, then candidate should have same type constructor and corresponding function type - // originalExpectType: (java.util.function.Consumer<(ACTUAL..ACTUAL?)>..java.util.function.Consumer<(ACTUAL..ACTUAL?)>?), candidateExpectType: Nothing - // functionTypeByOriginal: (((ACTUAL..ACTUAL?)) -> kotlin.Unit..(((ACTUAL..ACTUAL?)) -> kotlin.Unit)?), functionTypeByCandidate: null - // Seems related to https://github.com/assertj/assertj/issues/2357 assertThatCode { child1.pluginManager.apply("com.bakdata.sonar") } - .satisfies(causeWithMessage("top-level project")) + .satisfies { assertThat(it.cause).hasMessageContaining("top-level project") } } } diff --git a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginTest.kt b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginTest.kt index 9ed561c..8002015 100644 --- a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginTest.kt +++ b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginTest.kt @@ -43,8 +43,6 @@ internal class SonatypePluginTest { fun taskWithName(name: String): Condition = Condition({ it.name == name }, "Task with name $name") - fun causeWithMessage(message: String): Condition = Condition({ it.cause?.message?.contains(message) ?: false }, "Cause with message $message") - @Test fun testSingleModuleProject() { val project = ProjectBuilder.builder().build() @@ -114,13 +112,8 @@ internal class SonatypePluginTest { val parent = ProjectBuilder.builder().withName("parent").build() val child1 = ProjectBuilder.builder().withName("child1").withParent(parent).build() - // Error message is thrown when passing as Consumer to satisfies - // If original type is SAM type, then candidate should have same type constructor and corresponding function type - // originalExpectType: (java.util.function.Consumer<(ACTUAL..ACTUAL?)>..java.util.function.Consumer<(ACTUAL..ACTUAL?)>?), candidateExpectType: Nothing - // functionTypeByOriginal: (((ACTUAL..ACTUAL?)) -> kotlin.Unit..(((ACTUAL..ACTUAL?)) -> kotlin.Unit)?), functionTypeByCandidate: null - // Seems related to https://github.com/assertj/assertj/issues/2357 Assertions.assertThatCode { child1.apply(plugin = "com.bakdata.sonatype") } - .satisfies(causeWithMessage("top-level project")) + .satisfies { Assertions.assertThat(it.cause).hasMessageContaining("top-level project") } } }