Skip to content

Commit 4efbdd1

Browse files
runningcodeclaude
andcommitted
build(android): Pin Kotlin JVM toolchain to 8 across modules
Set jvmToolchain(8) for the navigation, replay, sqlite, and apache http client modules so the Kotlin compile toolchain is fixed under the Android 17 build, and import JvmTarget/KotlinVersion instead of using fully-qualified references. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cc72ae4 commit 4efbdd1

4 files changed

Lines changed: 26 additions & 14 deletions

File tree

sentry-android-navigation/build.gradle.kts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import io.gitlab.arturbosch.detekt.Detekt
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
4+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
25

36
plugins {
47
id("com.android.library")
@@ -24,9 +27,10 @@ android {
2427
}
2528

2629
kotlin {
27-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
28-
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
29-
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
30+
jvmToolchain(8)
31+
compilerOptions.jvmTarget = JVM_1_8
32+
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
33+
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
3034
}
3135

3236
testOptions {

sentry-android-replay/build.gradle.kts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import io.gitlab.arturbosch.detekt.Detekt
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
24
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
35

46
plugins {
@@ -33,9 +35,10 @@ android {
3335
}
3436

3537
kotlin {
36-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
37-
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
38-
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
38+
jvmToolchain(8)
39+
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
40+
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
41+
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
3942
}
4043

4144
testOptions {

sentry-android-sqlite/build.gradle.kts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import io.gitlab.arturbosch.detekt.Detekt
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
24

35
plugins {
46
id("com.android.library")
@@ -24,9 +26,10 @@ android {
2426
}
2527

2628
kotlin {
27-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
28-
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
29-
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
29+
jvmToolchain(8)
30+
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
31+
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
32+
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
3033
}
3134

3235
testOptions {

sentry-apache-http-client-5/build.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import net.ltgt.gradle.errorprone.errorprone
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
34

45
plugins {
56
`java-library`
@@ -10,10 +11,11 @@ plugins {
1011
alias(libs.plugins.gradle.versions)
1112
}
1213

13-
tasks.withType<KotlinCompile>().configureEach {
14-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
15-
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
16-
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
14+
kotlin {
15+
jvmToolchain(8)
16+
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
17+
compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9
18+
compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9
1719
}
1820

1921
dependencies {

0 commit comments

Comments
 (0)