Skip to content

Commit d756bf4

Browse files
committed
Upgrade build to Gradle 8.10
Closes gh-41980
1 parent 275d366 commit d756bf4

File tree

24 files changed

+99
-94
lines changed

24 files changed

+99
-94
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
- version: 17
2323
toolchain: false
2424
- version: 21
25-
toolchain: true
25+
toolchain: false
2626
- version: 22
27-
toolchain: true
27+
toolchain: false
2828
- version: 23
2929
early-access: true
30-
toolchain: true
30+
toolchain: false
3131
exclude:
3232
- os:
3333
name: Linux

buildSrc/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ repositories {
1010
gradlePluginPortal()
1111
}
1212

13-
sourceCompatibility = 17
14-
targetCompatibility = 17
13+
java {
14+
sourceCompatibility = 17
15+
targetCompatibility = 17
16+
}
17+
1518

1619
def versions = [:]
1720
new File(projectDir.parentFile, "gradle.properties").withInputStream {

buildSrc/src/main/java/org/springframework/boot/build/KotlinConventions.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class KotlinConventions {
5151
void apply(Project project) {
5252
project.getPlugins().withId("org.jetbrains.kotlin.jvm", (plugin) -> {
5353
project.getTasks().withType(KotlinCompile.class, this::configure);
54-
configureDokkatoo(project);
54+
project.getPlugins().withType(DokkatooHtmlPlugin.class, (dokkatooPlugin) -> configureDokkatoo(project));
5555
});
5656
}
5757

@@ -67,7 +67,6 @@ private void configure(KotlinCompile compile) {
6767
}
6868

6969
private void configureDokkatoo(Project project) {
70-
project.getPlugins().apply(DokkatooHtmlPlugin.class);
7170
DokkatooExtension dokkatoo = project.getExtensions().getByType(DokkatooExtension.class);
7271
dokkatoo.getDokkatooSourceSets().named(SourceSet.MAIN_SOURCE_SET_NAME).configure((sourceSet) -> {
7372
sourceSet.getSourceRoots().setFrom(project.file("src/main/kotlin"));

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/InteractiveUpgradeResolver.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.build.bom.bomr;
1818

19+
import java.util.ArrayList;
1920
import java.util.Collection;
2021
import java.util.HashMap;
2122
import java.util.List;
@@ -58,12 +59,17 @@ private Upgrade resolveUpgrade(LibraryWithVersionOptions libraryWithVersionOptio
5859
if (libraryWithVersionOptions.getVersionOptions().isEmpty()) {
5960
return null;
6061
}
61-
VersionOption current = new VersionOption(libraryWithVersionOptions.getLibrary().getVersion().getVersion());
62-
VersionOption selected = this.userInputHandler.selectOption(
63-
libraryWithVersionOptions.getLibrary().getName() + " "
64-
+ libraryWithVersionOptions.getLibrary().getVersion().getVersion(),
65-
libraryWithVersionOptions.getVersionOptions(), current);
66-
return (selected.equals(current)) ? null
62+
VersionOption defaultOption = new VersionOption(
63+
libraryWithVersionOptions.getLibrary().getVersion().getVersion());
64+
VersionOption selected = this.userInputHandler.askUser((questions) -> {
65+
String question = libraryWithVersionOptions.getLibrary().getName() + " "
66+
+ libraryWithVersionOptions.getLibrary().getVersion().getVersion();
67+
List<VersionOption> options = new ArrayList<>();
68+
options.add(defaultOption);
69+
options.addAll(libraryWithVersionOptions.getVersionOptions());
70+
return questions.selectOption(question, options, defaultOption);
71+
}).get();
72+
return (selected.equals(defaultOption)) ? null
6773
: new Upgrade(libraryWithVersionOptions.getLibrary(), selected.getVersion());
6874
}
6975

buildSrc/src/main/java/org/springframework/boot/build/test/DockerTestPlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ private void configureDockerTesting(Project project) {
7171
.add(project.getConfigurations()
7272
.getByName(dockerTestSourceSet.getRuntimeClasspathConfigurationName())));
7373
});
74+
project.getDependencies()
75+
.add(dockerTestSourceSet.getRuntimeOnlyConfigurationName(), "org.junit.platform:junit-platform-launcher");
7476
}
7577

7678
private SourceSet createSourceSet(Project project) {

buildSrc/src/main/java/org/springframework/boot/build/test/IntegrationTestPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,6 +58,8 @@ private void configureIntegrationTesting(Project project) {
5858
eclipse.classpath((classpath) -> classpath.getPlusConfigurations()
5959
.add(project.getConfigurations().getByName(intTestSourceSet.getRuntimeClasspathConfigurationName())));
6060
});
61+
project.getDependencies()
62+
.add(intTestSourceSet.getRuntimeOnlyConfigurationName(), "org.junit.platform:junit-platform-launcher");
6163
}
6264

6365
private SourceSet createSourceSet(Project project) {

gradle/wrapper/gradle-wrapper.jar

121 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

0 commit comments

Comments
 (0)