-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from abendt/gradle8_deprecations
fix gradle 9 deprecations
- Loading branch information
Showing
4 changed files
with
171 additions
and
60 deletions.
There are no files selected for viewing
168 changes: 168 additions & 0 deletions
168
...tegrationTest/kotlin/org/unbrokendome/gradle/plugins/testsets/Gradle8CompatibilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
package org.unbrokendome.gradle.plugins.testsets | ||
|
||
import assertk.assertThat | ||
import assertk.assertions.isIn | ||
import assertk.assertions.isNotNull | ||
import assertk.assertions.prop | ||
import org.gradle.testkit.runner.BuildTask | ||
import org.gradle.testkit.runner.GradleRunner | ||
import org.gradle.testkit.runner.TaskOutcome | ||
import org.junit.jupiter.api.BeforeEach | ||
import org.junit.jupiter.api.DisplayName | ||
import org.junit.jupiter.api.Nested | ||
import org.junit.jupiter.params.ParameterizedTest | ||
import org.junit.jupiter.params.provider.ValueSource | ||
|
||
|
||
class Gradle8CompatibilityTest : AbstractGradleIntegrationTest() { | ||
|
||
abstract inner class AbstractVersionsCompatibilityTest { | ||
|
||
@ValueSource(strings = [ | ||
"7.5.1", "7.6-rc-3" | ||
]) | ||
@ParameterizedTest(name = "Gradle {0}") | ||
@DisplayName("Should work in Gradle version") | ||
fun shouldWorkInGradleVersion(gradleVersion: String) { | ||
val result = GradleRunner.create() | ||
.withProjectDir(projectDir) | ||
.withGradleVersion(gradleVersion) | ||
.withPluginClasspath() | ||
.withArguments("integrationTest", "--info", "--stacktrace", "--warning-mode=fail") | ||
.forwardOutput() | ||
.build() | ||
|
||
assertThat(result, "result") | ||
.prop("for task integrationTest") { it.task(":integrationTest") } | ||
.isNotNull() | ||
.prop("outcome", BuildTask::getOutcome) | ||
.isIn(TaskOutcome.NO_SOURCE, TaskOutcome.UP_TO_DATE) | ||
} | ||
} | ||
|
||
@Nested | ||
inner class GroovySinple : AbstractVersionsCompatibilityTest() { | ||
|
||
@BeforeEach | ||
fun setup() { | ||
directory(projectDir) { | ||
file("build.gradle", """ | ||
plugins { | ||
id('org.unbroken-dome.test-sets') | ||
} | ||
testSets { integrationTest } | ||
""") | ||
} | ||
} | ||
} | ||
|
||
@Nested | ||
inner class KotlinSimple : AbstractVersionsCompatibilityTest() { | ||
|
||
@BeforeEach | ||
fun setup() { | ||
directory(projectDir) { | ||
file("build.gradle.kts", """ | ||
plugins { | ||
id("org.unbroken-dome.test-sets") | ||
} | ||
testSets { create("integrationTest") } | ||
""") | ||
} | ||
} | ||
} | ||
|
||
@Nested | ||
inner class GroovyExtendsOtherTestSet : AbstractVersionsCompatibilityTest() { | ||
|
||
@BeforeEach | ||
fun setup() { | ||
directory(projectDir) { | ||
file("build.gradle", """ | ||
plugins { | ||
id('org.unbroken-dome.test-sets') | ||
} | ||
testSets { | ||
extended | ||
integrationTest { | ||
extendsFrom extended | ||
} | ||
} | ||
""") | ||
} | ||
} | ||
} | ||
|
||
@Nested | ||
inner class KotlinExtendsOtherTestSet : AbstractVersionsCompatibilityTest() { | ||
|
||
@BeforeEach | ||
fun setup() { | ||
directory(projectDir) { | ||
file("build.gradle.kts", """ | ||
plugins { | ||
id("org.unbroken-dome.test-sets") | ||
} | ||
testSets { | ||
create("extended") | ||
create("integrationTest") { | ||
extendsFrom("extended") | ||
} | ||
} | ||
""") | ||
} | ||
} | ||
} | ||
|
||
@Nested | ||
inner class GroovyLibraries : AbstractVersionsCompatibilityTest() { | ||
|
||
@BeforeEach | ||
fun setup() { | ||
directory(projectDir) { | ||
file("build.gradle", """ | ||
plugins { | ||
id('org.unbroken-dome.test-sets') | ||
} | ||
testSets { | ||
libraries { testCommon } | ||
integrationTest { | ||
imports 'testCommon' | ||
} | ||
} | ||
""") | ||
} | ||
} | ||
} | ||
|
||
@Nested | ||
inner class KotlinLibraries : AbstractVersionsCompatibilityTest() { | ||
|
||
@BeforeEach | ||
fun setup() { | ||
directory(projectDir) { | ||
file("build.gradle.kts", """ | ||
plugins { | ||
id("org.unbroken-dome.test-sets") | ||
} | ||
testSets { | ||
val testCommon by libraries.creating | ||
create("integrationTest") { | ||
imports(testCommon) | ||
} | ||
} | ||
""") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/main/kotlin/org/unbrokendome/gradle/plugins/testsets/util/ClosureExtensions.kt
This file was deleted.
Oops, something went wrong.