Skip to content

Commit 16d56ef

Browse files
authored
Upgrade Gradle to 8.2.1 (#182)
* Upgrade Gradle to 8.2.1 * Use Hava toolchain instead of JVM compilation target
1 parent 8b76b3b commit 16d56ef

File tree

9 files changed

+29
-16
lines changed

9 files changed

+29
-16
lines changed

benchmarks/build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ plugins {
1313
}
1414

1515
kotlin {
16-
jvm()
16+
jvm {
17+
jvmToolchain {
18+
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
19+
}
20+
}
1721
// TODO: consider supporting non-host native targets.
1822
if (HostManager.host === KonanTarget.MACOS_X64) macosX64("native")
1923
if (HostManager.host === KonanTarget.MACOS_ARM64) macosArm64("native")
@@ -28,11 +32,11 @@ kotlin {
2832
}
2933
}
3034

31-
val jvmMain by getting {
35+
named("jvmMain") {
3236
dependsOn(commonMain.get())
3337
}
3438

35-
val nativeMain by getting {
39+
named("nativeMain") {
3640
dependsOn(commonMain.get())
3741
}
3842
}

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ subprojects {
6363
subprojects {
6464
tasks.withType<KotlinCompile>().configureEach {
6565
kotlinOptions {
66-
jvmTarget = JavaVersion.VERSION_1_8.toString()
6766
allWarningsAsErrors = true
6867
freeCompilerArgs += "-Xjvm-default=all"
6968
}

bytestring/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ plugins {
99

1010
kotlin {
1111
jvm {
12+
jvmToolchain {
13+
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
14+
}
1215
withJava()
1316
testRuns["test"].executionTask.configure {
1417
useJUnitPlatform()
@@ -41,8 +44,6 @@ kotlin {
4144
implementation(kotlin("test"))
4245
}
4346
}
44-
val jvmMain by getting
45-
val jvmTest by getting
4647

4748
createSourceSet("nativeMain", parent = commonMain, children = nativeTargets)
4849
createSourceSet("nativeTest", parent = commonTest, children = nativeTargets)

core/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ plugins {
1414

1515
kotlin {
1616
jvm {
17+
jvmToolchain {
18+
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
19+
}
1720
withJava()
1821
testRuns["test"].executionTask.configure {
1922
useJUnitPlatform()
@@ -50,8 +53,6 @@ kotlin {
5053
implementation(kotlin("test"))
5154
}
5255
}
53-
val jvmMain by getting
54-
val jvmTest by getting
5556

5657
createSourceSet("nativeMain", parent = commonMain, children = nativeTargets)
5758
createSourceSet("nativeTest", parent = commonTest, children = nativeTargets)

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[versions]
22
kotlin = "1.8.21"
3+
java = "8"
34
dokka = "1.8.20"
45
kover = "0.7.1"
56
bcv = "0.13.2"

gradle/wrapper/gradle-wrapper.jar

1.29 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
9087

9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
143140
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
143+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
144+
# shellcheck disable=SC3045
146145
MAX_FD=$( ulimit -H -n ) ||
147146
warn "Could not query maximum file descriptor limit"
148147
esac
149148
case $MAX_FD in #(
150149
'' | soft) :;; #(
151150
*)
151+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
152+
# shellcheck disable=SC3045
152153
ulimit -n "$MAX_FD" ||
153154
warn "Could not set maximum file descriptor limit to $MAX_FD"
154155
esac
@@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
193194
done
194195
fi
195196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
196201
# Collect all arguments for the java command;
197202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198203
# shell script including quotes and variable substitutions, so put them in

gradlew.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

0 commit comments

Comments
 (0)