Skip to content

Commit 3806b58

Browse files
fix(client): support kotlin 1.8 runtime (#352)
1 parent dfe7902 commit 3806b58

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

buildSrc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
`kotlin-dsl`
3-
kotlin("jvm") version "2.1.10"
3+
kotlin("jvm") version "1.9.20"
44
id("com.vanniktech.maven.publish") version "0.28.0"
55
}
66

@@ -11,6 +11,6 @@ repositories {
1111

1212
dependencies {
1313
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
14-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10")
14+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
1515
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
1616
}

buildSrc/src/main/kotlin/orb.java.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ java {
2323
toolchain {
2424
languageVersion.set(JavaLanguageVersion.of(17))
2525
}
26+
27+
sourceCompatibility = JavaVersion.VERSION_1_8
28+
targetCompatibility = JavaVersion.VERSION_1_8
2629
}
2730

2831
tasks.withType<JavaCompile>().configureEach {

buildSrc/src/main/kotlin/orb.kotlin.gradle.kts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import com.diffplug.gradle.spotless.SpotlessExtension
22
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
44

55
plugins {
66
id("orb.java")
@@ -11,25 +11,26 @@ kotlin {
1111
jvmToolchain {
1212
languageVersion.set(JavaLanguageVersion.of(17))
1313
}
14-
}
15-
16-
configure<SpotlessExtension> {
17-
kotlin {
18-
ktfmt().kotlinlangStyle()
19-
toggleOffOn()
20-
}
21-
}
2214

23-
tasks.withType<KotlinCompile>().configureEach {
2415
compilerOptions {
25-
allWarningsAsErrors = true
2616
freeCompilerArgs = listOf(
2717
"-Xjvm-default=all",
2818
"-Xjdk-release=1.8",
2919
// Suppress deprecation warnings because we may still reference and test deprecated members.
30-
"-Xsuppress-warning=DEPRECATION"
20+
// TODO: Replace with `-Xsuppress-warning=DEPRECATION` once we use Kotlin compiler 2.1.0+.
21+
"-nowarn",
3122
)
3223
jvmTarget.set(JvmTarget.JVM_1_8)
24+
languageVersion.set(KotlinVersion.KOTLIN_1_8)
25+
apiVersion.set(KotlinVersion.KOTLIN_1_8)
26+
coreLibrariesVersion = "1.8.0"
27+
}
28+
}
29+
30+
configure<SpotlessExtension> {
31+
kotlin {
32+
ktfmt().kotlinlangStyle()
33+
toggleOffOn()
3334
}
3435
}
3536

orb-java-example/build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
plugins {
2-
id("orb.kotlin")
32
id("java")
43
application
54
}
65

6+
repositories {
7+
mavenCentral()
8+
}
9+
710
dependencies {
811
implementation(project(":orb-java"))
912
}
1013

11-
tasks.withType<JavaCompile>().configureEach {
14+
java {
1215
// Allow using more modern APIs, like `List.of` and `Map.of`, in examples.
13-
options.release.set(9)
16+
sourceCompatibility = JavaVersion.VERSION_1_9
17+
targetCompatibility = JavaVersion.VERSION_1_9
1418
}
1519

1620
application {

0 commit comments

Comments
 (0)