Skip to content

Commit

Permalink
Upgrade to Gradle 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Mar 11, 2024
1 parent 195795f commit 5b756f9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.assertj.core.api.Condition
import org.assertj.core.api.SoftAssertions.assertSoftly
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.ProjectConfigurationException
import org.gradle.api.Task
import org.gradle.api.internal.project.DefaultProject
import org.gradle.kotlin.dsl.apply
Expand All @@ -40,7 +41,15 @@ import java.util.function.Consumer

internal class SonatypePluginTest {
fun Project.evaluate() {
(this as DefaultProject).evaluate()
val defaultProject: DefaultProject = this as DefaultProject
try {
defaultProject.evaluate()
} catch (e: ProjectConfigurationException) {
// FIXME bug since Gradle 7.3 https://github.com/gradle/gradle/issues/20301
if (e.message.equals("Failed to apply plugin 'org.gradle.build-init'.")) {
defaultProject.evaluate()
}
}
}

fun taskWithName(name: String): Condition<Task> = Condition({ it.name == name }, "Task with name $name")
Expand All @@ -61,7 +70,7 @@ internal class SonatypePluginTest {
}.doesNotThrowAnyException()

assertSoftly { softly ->
softly.assertThat(project.collectTasks())
softly.assertThat(project.tasks)
.haveExactly(1, taskWithName("signSonatypePublication"))
.haveExactly(1, taskWithName("publish"))
.haveExactly(1, taskWithName("publishToNexus"))
Expand Down

0 comments on commit 5b756f9

Please sign in to comment.