Skip to content

Commit 49bf096

Browse files
authored
Make sure that we compile to JRE 11. (#533 fixes #528)
2 parents 1cb2824 + a84d513 commit 49bf096

File tree

7 files changed

+38
-2
lines changed

7 files changed

+38
-2
lines changed

jvm/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1212

1313
## [Unreleased]
14+
### Fixed
15+
- Restore support for JRE 11. (fixes [#528](https://github.com/diffplug/selfie/issues/528))
1416

1517
## [2.5.2] - 2025-04-28
1618
### Fixed

jvm/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ver_OKIO=3.9.0
1010
ver_KOTLIN_TEST=2.0.0
1111
ver_KOTLIN_SERIALIZATION=1.7.3
1212
# Kotest 5.4.0 is the oldest that we support
13-
ver_KOTEST=5.4.0
13+
ver_KOTEST=5.4.0
14+
15+
ver_JVM_TARGET=11

jvm/gradle/jvm-target.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
if (plugins.hasPlugin('org.jetbrains.kotlin.jvm')) {
2+
kotlin {
3+
compileKotlin {
4+
kotlinOptions {
5+
jvmTarget = "$ver_JVM_TARGET"
6+
}
7+
}
8+
}
9+
tasks.named('compileJava', JavaCompile) {
10+
options.release = Integer.parseInt(ver_JVM_TARGET)
11+
}
12+
} else if (plugins.hasPlugin('org.jetbrains.kotlin.multiplatform')) {
13+
kotlin {
14+
jvm {
15+
compilations.all {
16+
kotlinOptions {
17+
jvmTarget = "$ver_JVM_TARGET"
18+
}
19+
}
20+
}
21+
targets.withType(org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget) {
22+
compilations.all {
23+
kotlinOptions {
24+
jvmTarget = "$ver_JVM_TARGET"
25+
}
26+
}
27+
}
28+
}
29+
}

jvm/selfie-lib/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ tasks.create('test') {
5858

5959
// it all needs to get published and formatted
6060
apply from: 干.file('base/maven.gradle')
61-
apply from: 干.file('base/sonatype.gradle')
61+
apply from: 干.file('base/sonatype.gradle')
62+
apply from: rootProject.file('gradle/jvm-target.gradle')

jvm/selfie-runner-junit5/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ test {
3535
// it all needs to get published and formatted
3636
apply from: 干.file('base/maven.gradle')
3737
apply from: 干.file('base/sonatype.gradle')
38+
apply from: rootProject.file('gradle/jvm-target.gradle')

jvm/selfie-runner-kotest/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ jvmTest {
5959
// it all needs to get published and formatted
6060
apply from: 干.file('base/maven.gradle')
6161
apply from: 干.file('base/sonatype.gradle')
62+
apply from: rootProject.file('gradle/jvm-target.gradle')

jvm/undertest-junit5-kotest/harness/gradle/jvm-target.gradle

Whitespace-only changes.

0 commit comments

Comments
 (0)