Skip to content

Commit

Permalink
Remove Spring 3 from tests, tweak test task setup
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard84 committed Feb 9, 2023
1 parent 604d91d commit 9197653
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions spock-spring/spring.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Supports Spring 2.5.x, 3.x, and 4.x."

def springVersion = "4.3.5.RELEASE"
def testSpringVersions = [
"3.2.16.RELEASE": (8..8),
(springVersion): (8..11),
"5.0.2.RELEASE": (8..11),
"6.0.0": (17..17)
].findAll { javaVersion in it.value }
].findAll { javaVersion in it.value }.keySet()

dependencies {
api project(":spock-core")
Expand Down Expand Up @@ -51,8 +50,9 @@ testing {
}


testSpringVersions.each { testSpringVersion, __ ->
"spring${testSpringVersion.charAt(0)}"(JvmTestSuite) {
[testSpringVersions, [false, true]].combinations().each { testSpringVersion, forceCgLib ->
String testTaskName = "spring${testSpringVersion.charAt(0)}${forceCgLib ? '': 'CgLib'}"
"$testTaskName"(JvmTestSuite) {

sources {
java {
Expand All @@ -76,18 +76,17 @@ testing {
implementation "org.springframework:spring-tx:$testSpringVersion"
}
}
check.dependsOn testTaskName
}
}
}

task testCglib(type: Test) {
systemProperty("org.spockframework.mock.ignoreByteBuddy", "true")
mustRunAfter test
["compileTestJava", "compileTestGroovy"].each { taskName ->
tasks.named(taskName).configure {
onlyIf { false } //skip normal test task
}
}

check.dependsOn testCglib
check.dependsOn testSpringVersions.collect {k,v -> "spring${k.charAt(0)}" }

jar {
manifest {
attributes(
Expand Down

0 comments on commit 9197653

Please sign in to comment.