Skip to content

Commit 4639fff

Browse files
authored
Update to Gradle 9 (#2202)
1 parent 3493297 commit 4639fff

File tree

9 files changed

+34
-27
lines changed

9 files changed

+34
-27
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ ext {
4949
}
5050

5151
groovyDependencies = [
52-
[group: groovyGroup, name: "groovy", version: groovyVersion]
52+
dependencyFactory.create(groovyGroup, "groovy", groovyVersion)
5353
]
5454
groovyConsoleExtraDependencies = [
55-
[group: groovyGroup, name: "groovy-console", version: groovyVersion],
56-
[group: groovyGroup, name: "groovy-test-junit5", version: groovyVersion], // for executing specs
57-
[group: "org.apache.ivy", name: "ivy", version: "2.5.3"] // for @Grab support
55+
dependencyFactory.create(groovyGroup, "groovy-console", groovyVersion),
56+
dependencyFactory.create(groovyGroup, "groovy-test-junit5", groovyVersion), // for executing specs
57+
dependencyFactory.create("org.apache.ivy", "ivy", "2.5.3"), // For @Grab support
5858
]
5959
maxGroovyVersion = snapshotVersion ? "9.9.99" : maxGroovyVersion
6060
if (System.getProperty("groovyVersion")) {

gradle/publishMaven.gradle

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ ext {
88
publishing {
99
publications {
1010
maven(MavenPublication) {
11-
afterEvaluate {
12-
pom.packaging = project.ext.packaging
13-
if (project.ext.packaging == "pom") {
14-
from(components.javaPlatform)
15-
} else {
16-
from(components.java)
17-
artifact(sourcesJar)
18-
artifact(javadocJar)
19-
}
11+
pluginManager.withPlugin("java-library") {
12+
from(components.java)
13+
artifact(sourcesJar)
14+
artifact(javadocJar)
15+
}
16+
pluginManager.withPlugin("java-platform") {
17+
from(components.javaPlatform)
2018
}
2119
pom {
2220
name = provider { project.ext.displayName }

gradle/wrapper/gradle-wrapper.jar

1.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH="\\\"\\\""
118117

119118

120119
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
172171
# For Cygwin or MSYS, switch paths to Windows format before running java
173172
if "$cygwin" || "$msys" ; then
174173
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176174

177175
JAVACMD=$( cygpath --unix "$JAVACMD" )
178176

@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
212210

213211
set -- \
214212
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215-
-classpath "$CLASSPATH" \
216213
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217214
"$@"
218215

gradlew.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=
7473

7574

7675
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
76+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7877

7978
:end
8079
@rem End local scope for the variables with windows NT shell

spock-core/core.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ dependencies {
4747

4848

4949
tasks.named("jar", Jar) {
50+
def projName = project.name
5051
manifest {
5152
attributes(
5253
'Build-Revision': versioning.info.commit,
53-
'Specification-Title': project.name,
54+
'Specification-Title': projName,
5455
'Specification-Version': baseVersion,
5556
'Specification-Vendor': 'spockframework.org',
56-
'Implementation-Title': project.name,
57+
'Implementation-Title': projName,
5758
'Implementation-Version': variantLessVersion,
5859
'Implementation-Vendor': 'spockframework.org',
5960
'Automatic-Module-Name': 'org.spockframework.core'

spock-spring/boot2-test/boot2-test.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.springframework.boot.gradle.plugin.SpringBootPlugin
2+
13
/*
24
* Copyright 2018 the original author or authors.
35
*
@@ -15,8 +17,18 @@
1517
*/
1618

1719
plugins {
18-
id "io.spring.dependency-management" version "1.0.5.RELEASE"
19-
id 'org.springframework.boot' version "2.5.3"
20+
// Normally, the Spring Boot 2 Gradle Plugin would not be compatible with Gradle 9+
21+
// To get around this issue, we use the dependency-management plugin in isolation
22+
// as described here: https://docs.spring.io/spring-boot/docs/2.7.7/gradle-plugin/reference/htmlsingle/#managing-dependencies.dependency-management-plugin.using-in-isolation
23+
// This way, we get proper test execution and realistic version resolution on Gradle 9
24+
id 'org.springframework.boot' version "2.7.18" apply false
25+
id "io.spring.dependency-management" version "1.1.7"
26+
}
27+
28+
dependencyManagement {
29+
imports {
30+
mavenBom SpringBootPlugin.BOM_COORDINATES
31+
}
2032
}
2133

2234
// Spring dependency management downgrades the jupiter version to 5.7.2 otherwise

spock-spring/boot3-test/boot3-test.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
plugins {
17-
id 'org.springframework.boot' version '3.0.0'
18-
id 'io.spring.dependency-management' version '1.1.0'
17+
id 'org.springframework.boot' version '3.5.5'
18+
id 'io.spring.dependency-management' version '1.1.7'
1919
id 'groovy'
2020
}
2121

0 commit comments

Comments
 (0)