Skip to content

Commit b20a96b

Browse files
author
ntwigg
committed
Make sure that we compile to JRE 11.
1 parent 1cb2824 commit b20a96b

File tree

5 files changed

+42
-2
lines changed

5 files changed

+42
-2
lines changed

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: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
if (plugins.hasPlugin('org.jetbrains.kotlin.jvm')) {
2+
kotlin {
3+
compileKotlin {
4+
kotlinOptions {
5+
jvmTarget = "$ver_JVM_TARGET"
6+
}
7+
}
8+
compileTestKotlin {
9+
kotlinOptions {
10+
jvmTarget = "$ver_JVM_TARGET"
11+
}
12+
}
13+
}
14+
java {
15+
sourceCompatibility = JavaVersion.toVersion("$ver_JVM_TARGET")
16+
targetCompatibility = JavaVersion.toVersion("$ver_JVM_TARGET")
17+
}
18+
} else if (plugins.hasPlugin('org.jetbrains.kotlin.multiplatform')) {
19+
kotlin {
20+
jvm {
21+
compilations.all {
22+
kotlinOptions {
23+
jvmTarget = "$ver_JVM_TARGET"
24+
}
25+
}
26+
}
27+
targets.withType(org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget) {
28+
compilations.all {
29+
kotlinOptions {
30+
jvmTarget = "$ver_JVM_TARGET"
31+
}
32+
}
33+
}
34+
}
35+
}

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')

0 commit comments

Comments
 (0)