From 387bba9539305a94e66ba67f9f7c75f4918603d2 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 6 Nov 2026 09:38:29 +0100 Subject: [PATCH 1/3] build: Bump Kotlin to 2.4.21 and the language/API version to 2.0 Kotlin 2.4 rejects language and API version 1.9, so the Kotlin modules now target 2.0 and depend on kotlin-stdlib 2.0.21. Kotlin applications need Kotlin 1.9 or newer, up from 1.8. KGP 2.4 replaced the experimental ABI validation DSL, so enable it through abiValidation {}. Its dumper no longer lists synthetic constructors, which drops three lines from the sqlite and navigation3 dumps. Compiling at 2.0 uses K2, which adds getEntries() to Kotlin enums, references kotlin.jvm.JvmField from Compose $stable fields, and compiles locals of suppressed internal Compose types to error.NonExistentClass, so type those test locals explicitly. Co-Authored-By: Claude Opus 5.5 --- .../gradle/SentryApiValidationPlugin.kt | 19 ++-- buildSrc/src/main/java/Config.kt | 2 +- gradle/libs.versions.toml | 4 +- sentry-android-distribution/build.gradle.kts | 2 +- .../api/sentry-android-fragment.api | 1 + sentry-android-fragment/build.gradle.kts | 4 +- .../test-app-size/proguard-rules.pro | 1 + sentry-android-navigation/build.gradle.kts | 4 +- .../api/sentry-android-navigation3.api | 1 - sentry-android-navigation3/build.gradle.kts | 4 +- sentry-android-replay/build.gradle.kts | 4 +- .../api/sentry-android-sqlite.api | 2 - sentry-android-sqlite/build.gradle.kts | 4 +- sentry-android-timber/build.gradle.kts | 4 +- sentry-apollo-3/build.gradle.kts | 4 +- sentry-apollo-4/build.gradle.kts | 4 +- sentry-apollo-5/build.gradle.kts | 4 +- sentry-apollo/build.gradle.kts | 4 +- sentry-compose/build.gradle.kts | 14 +-- .../ComposeGestureTargetLocatorTest.kt | 107 +++++++++--------- .../ComposeViewHierarchyExporterTest.kt | 11 +- sentry-graphql-22/build.gradle.kts | 4 +- sentry-graphql-core/build.gradle.kts | 4 +- sentry-graphql/build.gradle.kts | 4 +- sentry-jcache/build.gradle.kts | 4 +- sentry-kotlin-extensions/build.gradle.kts | 4 +- sentry-ktor-client/build.gradle.kts | 4 +- sentry-launchdarkly-server/build.gradle.kts | 4 +- sentry-okhttp/build.gradle.kts | 4 +- sentry-openfeature/build.gradle.kts | 4 +- sentry-quartz/build.gradle.kts | 4 +- sentry-reactor/build.gradle.kts | 4 +- .../sentry-samples-spring-7/build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- sentry-servlet-jakarta/build.gradle.kts | 4 +- sentry-servlet/build.gradle.kts | 4 +- sentry-spring-boot-4-starter/build.gradle.kts | 4 +- sentry-spring-boot-4/build.gradle.kts | 2 +- sentry-spring-boot-jakarta/build.gradle.kts | 4 +- .../build.gradle.kts | 4 +- sentry-spring-boot-starter/build.gradle.kts | 4 +- sentry-spring-boot/build.gradle.kts | 4 +- sentry-spring-jakarta/build.gradle.kts | 4 +- sentry-spring/build.gradle.kts | 4 +- sentry-test-support/build.gradle.kts | 4 +- 50 files changed, 159 insertions(+), 159 deletions(-) diff --git a/build-logic/src/main/kotlin/io/sentry/gradle/SentryApiValidationPlugin.kt b/build-logic/src/main/kotlin/io/sentry/gradle/SentryApiValidationPlugin.kt index f4c1dca5948..3e83a8e25c2 100644 --- a/build-logic/src/main/kotlin/io/sentry/gradle/SentryApiValidationPlugin.kt +++ b/build-logic/src/main/kotlin/io/sentry/gradle/SentryApiValidationPlugin.kt @@ -1,12 +1,9 @@ package io.sentry.gradle -import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.plugins.ExtensionAware import org.gradle.kotlin.dsl.create -import org.jetbrains.kotlin.gradle.dsl.abi.AbiValidationExtension -import org.jetbrains.kotlin.gradle.dsl.abi.AbiValidationMultiplatformExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation private val KOTLIN_PLUGIN_IDS = @@ -34,14 +31,12 @@ class SentryApiValidationPlugin : Plugin { } private fun enable(project: Project, extension: ApiValidationExtension) { - val kotlin = project.extensions.getByName("kotlin") as ExtensionAware - when (val abi = kotlin.extensions.getByName("abiValidation")) { - is AbiValidationMultiplatformExtension -> abi.also { it.enabled.set(true) } - is AbiValidationExtension -> abi.also { it.enabled.set(true) } - else -> throw GradleException("Unexpected abiValidation extension: ${abi.javaClass.name}") - }.filters { - // Lazy, because the module configures the extension after this plugin has been applied. - exclude { byNames.addAll(extension.ignoredPackages.map { it.map { pkg -> "$pkg.**" } }) } + val kotlin = project.extensions.getByName("kotlin") as KotlinTopLevelExtension + kotlin.abiValidation { + filters { + // Lazy, because the module configures the extension after this plugin has been applied. + exclude { byNames.addAll(extension.ignoredPackages.map { it.map { pkg -> "$pkg.**" } }) } + } } } } diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index 05786658ef3..00538facdd0 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -2,7 +2,7 @@ object Config { val AGP = System.getenv("VERSION_AGP") ?: "9.4.0" val kotlinStdLib = "stdlib-jdk8" - val kotlinStdLibVersionAndroid = "1.9.24" + val kotlinStdLibVersionAndroid = "2.0.21" val kotlinTestJunit = "test-junit" object BuildPlugins { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 49f20a5b213..cf84ce73cd9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,8 +15,8 @@ feign = "11.6" gummyBears = "0.12.0" jackson = "2.18.3" jetbrainsCompose = "1.6.11" -kotlin = "2.3.21" -kotlin-compatible-version = "1.9" +kotlin = "2.4.21" +kotlin-compatible-version = "2.0" ksp = "2.3.9" ktorClient = "3.0.0" logback = "1.2.9" diff --git a/sentry-android-distribution/build.gradle.kts b/sentry-android-distribution/build.gradle.kts index 967d48119fe..1efa5e203be 100644 --- a/sentry-android-distribution/build.gradle.kts +++ b/sentry-android-distribution/build.gradle.kts @@ -30,7 +30,7 @@ android { kotlin { compilerOptions.jvmTarget = JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 explicitApi() } diff --git a/sentry-android-fragment/api/sentry-android-fragment.api b/sentry-android-fragment/api/sentry-android-fragment.api index ddd7d0f6699..8cb71e51a91 100644 --- a/sentry-android-fragment/api/sentry-android-fragment.api +++ b/sentry-android-fragment/api/sentry-android-fragment.api @@ -34,6 +34,7 @@ public final class io/sentry/android/fragment/FragmentLifecycleState : java/lang public static final field STOPPED Lio/sentry/android/fragment/FragmentLifecycleState; public static final field VIEW_CREATED Lio/sentry/android/fragment/FragmentLifecycleState; public static final field VIEW_DESTROYED Lio/sentry/android/fragment/FragmentLifecycleState; + public static fun getEntries ()Lkotlin/enums/EnumEntries; public static fun valueOf (Ljava/lang/String;)Lio/sentry/android/fragment/FragmentLifecycleState; public static fun values ()[Lio/sentry/android/fragment/FragmentLifecycleState; } diff --git a/sentry-android-fragment/build.gradle.kts b/sentry-android-fragment/build.gradle.kts index 9384b199959..f28e5c76f7a 100644 --- a/sentry-android-fragment/build.gradle.kts +++ b/sentry-android-fragment/build.gradle.kts @@ -33,8 +33,8 @@ android { kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = KotlinVersion.KOTLIN_2_0 } testOptions { diff --git a/sentry-android-integration-tests/test-app-size/proguard-rules.pro b/sentry-android-integration-tests/test-app-size/proguard-rules.pro index 4db0031ab00..9fe8c83a00c 100644 --- a/sentry-android-integration-tests/test-app-size/proguard-rules.pro +++ b/sentry-android-integration-tests/test-app-size/proguard-rules.pro @@ -40,6 +40,7 @@ -dontwarn timber.log.Timber$Tree -dontwarn kotlin.Deprecated -dontwarn kotlin.Function +-dontwarn kotlin.jvm.JvmField -dontwarn kotlin.jvm.JvmStatic -dontwarn kotlin.jvm.functions.Function2 -dontwarn kotlin.jvm.functions.Function3 diff --git a/sentry-android-navigation/build.gradle.kts b/sentry-android-navigation/build.gradle.kts index 4b097f246c4..c0c02481b4f 100644 --- a/sentry-android-navigation/build.gradle.kts +++ b/sentry-android-navigation/build.gradle.kts @@ -33,8 +33,8 @@ android { kotlin { compilerOptions.jvmTarget = JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = KotlinVersion.KOTLIN_2_0 } testOptions { diff --git a/sentry-android-navigation3/api/sentry-android-navigation3.api b/sentry-android-navigation3/api/sentry-android-navigation3.api index 45f0482ed82..4b48dee36af 100644 --- a/sentry-android-navigation3/api/sentry-android-navigation3.api +++ b/sentry-android-navigation3/api/sentry-android-navigation3.api @@ -27,7 +27,6 @@ public final class io/sentry/compose/navigation3/SentryNavEffectKt { public final class io/sentry/compose/navigation3/SentryNavOptions { public static final field $stable I - public synthetic fun (ZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun equals (Ljava/lang/Object;)Z public final fun getCaptureBackStack ()Z public final fun getEnableNavigationBreadcrumbs ()Z diff --git a/sentry-android-navigation3/build.gradle.kts b/sentry-android-navigation3/build.gradle.kts index 6f8962a8edf..4159d439f24 100644 --- a/sentry-android-navigation3/build.gradle.kts +++ b/sentry-android-navigation3/build.gradle.kts @@ -31,8 +31,8 @@ android { kotlin { compilerOptions.jvmTarget = JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = KotlinVersion.KOTLIN_2_0 } testOptions { diff --git a/sentry-android-replay/build.gradle.kts b/sentry-android-replay/build.gradle.kts index 7794e32c55e..1625470912e 100644 --- a/sentry-android-replay/build.gradle.kts +++ b/sentry-android-replay/build.gradle.kts @@ -41,8 +41,8 @@ android { kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = KotlinVersion.KOTLIN_2_0 } testOptions { diff --git a/sentry-android-sqlite/api/sentry-android-sqlite.api b/sentry-android-sqlite/api/sentry-android-sqlite.api index 7b9f633b46a..2f9ebbc1ff7 100644 --- a/sentry-android-sqlite/api/sentry-android-sqlite.api +++ b/sentry-android-sqlite/api/sentry-android-sqlite.api @@ -8,7 +8,6 @@ public final class io/sentry/android/sqlite/BuildConfig { public final class io/sentry/android/sqlite/SentrySupportSQLiteOpenHelper : androidx/sqlite/db/SupportSQLiteOpenHelper { public static final field Companion Lio/sentry/android/sqlite/SentrySupportSQLiteOpenHelper$Companion; - public synthetic fun (Landroidx/sqlite/db/SupportSQLiteOpenHelper;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public fun close ()V public static final fun create (Landroidx/sqlite/db/SupportSQLiteOpenHelper;)Landroidx/sqlite/db/SupportSQLiteOpenHelper; public fun getDatabaseName ()Ljava/lang/String; @@ -23,7 +22,6 @@ public final class io/sentry/android/sqlite/SentrySupportSQLiteOpenHelper$Compan public final class io/sentry/sqlite/SentrySQLiteDriver : androidx/sqlite/SQLiteDriver { public static final field Companion Lio/sentry/sqlite/SentrySQLiteDriver$Companion; - public synthetic fun (Landroidx/sqlite/SQLiteDriver;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public static final fun create (Landroidx/sqlite/SQLiteDriver;)Landroidx/sqlite/SQLiteDriver; public fun hasConnectionPool ()Z public fun open (Ljava/lang/String;)Landroidx/sqlite/SQLiteConnection; diff --git a/sentry-android-sqlite/build.gradle.kts b/sentry-android-sqlite/build.gradle.kts index e9812a2f98f..d4ba0c318ae 100644 --- a/sentry-android-sqlite/build.gradle.kts +++ b/sentry-android-sqlite/build.gradle.kts @@ -33,8 +33,8 @@ android { kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = KotlinVersion.KOTLIN_2_0 } testOptions { diff --git a/sentry-android-timber/build.gradle.kts b/sentry-android-timber/build.gradle.kts index cbcd730c743..30643629096 100644 --- a/sentry-android-timber/build.gradle.kts +++ b/sentry-android-timber/build.gradle.kts @@ -40,8 +40,8 @@ android { kotlin { compilerOptions.jvmTarget = JvmTarget.JVM_11 - compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = KotlinVersion.KOTLIN_2_0 } testOptions { diff --git a/sentry-apollo-3/build.gradle.kts b/sentry-apollo-3/build.gradle.kts index 6467521f328..8e9df5ee581 100644 --- a/sentry-apollo-3/build.gradle.kts +++ b/sentry-apollo-3/build.gradle.kts @@ -15,8 +15,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-apollo-4/build.gradle.kts b/sentry-apollo-4/build.gradle.kts index 3bb166ae9a9..d7c8c4f2ede 100644 --- a/sentry-apollo-4/build.gradle.kts +++ b/sentry-apollo-4/build.gradle.kts @@ -15,8 +15,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-apollo-5/build.gradle.kts b/sentry-apollo-5/build.gradle.kts index 4d97069a707..994bf849a1a 100644 --- a/sentry-apollo-5/build.gradle.kts +++ b/sentry-apollo-5/build.gradle.kts @@ -14,8 +14,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-apollo/build.gradle.kts b/sentry-apollo/build.gradle.kts index fbffae9455c..9684879e45c 100644 --- a/sentry-apollo/build.gradle.kts +++ b/sentry-apollo/build.gradle.kts @@ -15,8 +15,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-compose/build.gradle.kts b/sentry-compose/build.gradle.kts index 3bfc82b48be..26777bce166 100644 --- a/sentry-compose/build.gradle.kts +++ b/sentry-compose/build.gradle.kts @@ -21,20 +21,20 @@ kotlin { androidTarget { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) - apiVersion.set(KotlinVersion.KOTLIN_1_9) - languageVersion.set(KotlinVersion.KOTLIN_1_9) + apiVersion.set(KotlinVersion.KOTLIN_2_0) + languageVersion.set(KotlinVersion.KOTLIN_2_0) } publishLibraryVariants("release") } jvm("desktop") { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) - apiVersion.set(KotlinVersion.KOTLIN_1_9) - languageVersion.set(KotlinVersion.KOTLIN_1_9) + apiVersion.set(KotlinVersion.KOTLIN_2_0) + languageVersion.set(KotlinVersion.KOTLIN_2_0) } } - coreLibrariesVersion = "1.8" + coreLibrariesVersion = "2.0.21" sourceSets.all { // Allow all experimental APIs, since MPP projects are themselves experimental @@ -47,8 +47,8 @@ kotlin { sourceSets { getByName("commonMain") { compilerOptions { - apiVersion.set(KotlinVersion.KOTLIN_1_9) - languageVersion.set(KotlinVersion.KOTLIN_1_9) + apiVersion.set(KotlinVersion.KOTLIN_2_0) + languageVersion.set(KotlinVersion.KOTLIN_2_0) } } getByName("androidMain") { diff --git a/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocatorTest.kt b/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocatorTest.kt index 8efdf3ebe30..35f68a352fd 100644 --- a/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocatorTest.kt +++ b/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/gestures/ComposeGestureTargetLocatorTest.kt @@ -1,5 +1,8 @@ @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +// LayoutNode and Owner locals are typed explicitly: under these suppressions K2 infers their type +// as an error type, and the test then fails with NoClassDefFoundError: error/NonExistentClass. + package io.sentry.compose.gestures import androidx.compose.runtime.collection.mutableVectorOf @@ -59,8 +62,8 @@ class ComposeGestureTargetLocatorTest { @Test fun `returns null when no clickable elements`() { - val root = mockLayoutNode(isPlaced = true, tag = "root", width = 100, height = 100) - val owner = mockOwner(root) + val root: LayoutNode = mockLayoutNode(isPlaced = true, tag = "root", width = 100, height = 100) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNull(result) @@ -68,7 +71,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `detects clickable via SemanticsModifier OnClick`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "btn", @@ -76,7 +79,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("OnClick"), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -84,7 +87,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(clickableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNotNull(result) @@ -94,7 +97,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `detects scrollable via SemanticsModifier ScrollBy`() { - val scrollableChild = + val scrollableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "list", @@ -102,7 +105,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("ScrollBy"), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -110,7 +113,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(scrollableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.SCROLLABLE) assertNotNull(result) @@ -119,7 +122,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `detects clickable via ClickableElement modifier`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "btn", @@ -127,7 +130,7 @@ class ComposeGestureTargetLocatorTest { height = 50, nodeModifierClassName = "androidx.compose.foundation.ClickableElement", ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -135,7 +138,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(clickableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNotNull(result) @@ -144,7 +147,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `detects clickable via CombinedClickableElement modifier`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "btn", @@ -152,7 +155,7 @@ class ComposeGestureTargetLocatorTest { height = 50, nodeModifierClassName = "androidx.compose.foundation.CombinedClickableElement", ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -160,7 +163,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(clickableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNotNull(result) @@ -169,7 +172,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `detects scrollable via ScrollingLayoutElement modifier`() { - val scrollableChild = + val scrollableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "scroll", @@ -177,7 +180,7 @@ class ComposeGestureTargetLocatorTest { height = 50, nodeModifierClassName = "androidx.compose.foundation.ScrollingLayoutElement", ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -185,7 +188,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(scrollableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.SCROLLABLE) assertNotNull(result) @@ -194,7 +197,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `detects scrollable via ScrollingContainerElement modifier`() { - val scrollableChild = + val scrollableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "scroll", @@ -202,7 +205,7 @@ class ComposeGestureTargetLocatorTest { height = 50, nodeModifierClassName = "androidx.compose.foundation.ScrollingContainerElement", ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -210,7 +213,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(scrollableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.SCROLLABLE) assertNotNull(result) @@ -219,7 +222,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `ignores clickable when looking for scrollable`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "btn", @@ -227,7 +230,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("OnClick"), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -235,7 +238,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(clickableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.SCROLLABLE) assertNull(result) @@ -243,7 +246,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `ignores scrollable when looking for clickable`() { - val scrollableChild = + val scrollableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "list", @@ -251,7 +254,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("ScrollBy"), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -259,7 +262,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(scrollableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNull(result) @@ -267,7 +270,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `skips unplaced nodes`() { - val unplacedClickable = + val unplacedClickable: LayoutNode = mockLayoutNode( isPlaced = false, tag = "btn", @@ -275,7 +278,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("OnClick"), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -283,7 +286,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(unplacedClickable), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNull(result) @@ -291,7 +294,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `skips nodes outside bounds`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "btn", @@ -301,7 +304,7 @@ class ComposeGestureTargetLocatorTest { left = 200f, top = 200f, ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -309,7 +312,7 @@ class ComposeGestureTargetLocatorTest { height = 300, children = listOf(clickableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) // click at (5, 5) is outside the child bounds (200-250, 200-250) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) @@ -318,7 +321,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `child inherits parent tag`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -326,7 +329,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("OnClick"), ) - val taggedParent = + val taggedParent: LayoutNode = mockLayoutNode( isPlaced = true, tag = "parent_tag", @@ -334,7 +337,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(clickableChild), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -342,7 +345,7 @@ class ComposeGestureTargetLocatorTest { height = 200, children = listOf(taggedParent), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNotNull(result) @@ -351,7 +354,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `returns deepest clickable for clicks`() { - val deepChild = + val deepChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "deep_btn", @@ -359,7 +362,7 @@ class ComposeGestureTargetLocatorTest { height = 20, semanticsKeys = listOf("OnClick"), ) - val parentClickable = + val parentClickable: LayoutNode = mockLayoutNode( isPlaced = true, tag = "parent_btn", @@ -368,7 +371,7 @@ class ComposeGestureTargetLocatorTest { semanticsKeys = listOf("OnClick"), children = listOf(deepChild), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -376,7 +379,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(parentClickable), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNotNull(result) @@ -385,7 +388,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `returns first scrollable immediately`() { - val deepScrollable = + val deepScrollable: LayoutNode = mockLayoutNode( isPlaced = true, tag = "deep_scroll", @@ -393,7 +396,7 @@ class ComposeGestureTargetLocatorTest { height = 20, semanticsKeys = listOf("ScrollBy"), ) - val parentScrollable = + val parentScrollable: LayoutNode = mockLayoutNode( isPlaced = true, tag = "parent_scroll", @@ -402,7 +405,7 @@ class ComposeGestureTargetLocatorTest { semanticsKeys = listOf("ScrollBy"), children = listOf(deepScrollable), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -410,7 +413,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(parentScrollable), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.SCROLLABLE) assertNotNull(result) @@ -419,7 +422,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `returns null when node has no tag and no parent tag`() { - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -427,7 +430,7 @@ class ComposeGestureTargetLocatorTest { height = 50, semanticsKeys = listOf("OnClick"), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -435,7 +438,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(clickableChild), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNull(result) @@ -444,7 +447,7 @@ class ComposeGestureTargetLocatorTest { @Test fun `finds tagged clickable nested under untagged containers`() { // Tree: root(no tag) -> container(no tag) -> container(no tag) -> clickable(tag="deep_btn") - val clickableChild = + val clickableChild: LayoutNode = mockLayoutNode( isPlaced = true, tag = "deep_btn", @@ -452,7 +455,7 @@ class ComposeGestureTargetLocatorTest { height = 10, semanticsKeys = listOf("OnClick"), ) - val innerContainer = + val innerContainer: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -460,7 +463,7 @@ class ComposeGestureTargetLocatorTest { height = 30, children = listOf(clickableChild), ) - val outerContainer = + val outerContainer: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -468,7 +471,7 @@ class ComposeGestureTargetLocatorTest { height = 60, children = listOf(innerContainer), ) - val root = + val root: LayoutNode = mockLayoutNode( isPlaced = true, tag = null, @@ -476,7 +479,7 @@ class ComposeGestureTargetLocatorTest { height = 100, children = listOf(outerContainer), ) - val owner = mockOwner(root) + val owner: Owner = mockOwner(root) val result = locator.locate(owner, 5f, 5f, UiElement.Type.CLICKABLE) assertNotNull(result) diff --git a/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/viewhierarchy/ComposeViewHierarchyExporterTest.kt b/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/viewhierarchy/ComposeViewHierarchyExporterTest.kt index 7113db59d6c..e2bcaba4d3c 100644 --- a/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/viewhierarchy/ComposeViewHierarchyExporterTest.kt +++ b/sentry-compose/src/androidUnitTest/kotlin/io/sentry/compose/viewhierarchy/ComposeViewHierarchyExporterTest.kt @@ -1,5 +1,8 @@ @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // to access internal vals +// LayoutNode locals are typed explicitly: under these suppressions K2 infers their type as an error +// type, and the test then fails with NoClassDefFoundError: error/NonExistentClass. + package io.sentry.compose.viewhierarchy import androidx.compose.runtime.collection.mutableVectorOf @@ -26,10 +29,10 @@ class ComposeViewHierarchyExporterTest { fun testComposeViewHierarchyExport() { val rootVhNode = ViewHierarchyNode() - val childA = mockLayoutNode(true, "childA", 10, 20) - val childB = mockLayoutNode(true, null, 10, 20) - val childC = mockLayoutNode(false, null, 10, 20) - val parent = mockLayoutNode(true, "root", 30, 40, listOf(childA, childB, childC)) + val childA: LayoutNode = mockLayoutNode(true, "childA", 10, 20) + val childB: LayoutNode = mockLayoutNode(true, null, 10, 20) + val childC: LayoutNode = mockLayoutNode(false, null, 10, 20) + val parent: LayoutNode = mockLayoutNode(true, "root", 30, 40, listOf(childA, childB, childC)) val node = mock() whenever(node.root).thenReturn(parent) diff --git a/sentry-graphql-22/build.gradle.kts b/sentry-graphql-22/build.gradle.kts index 4b01f5769f5..e1b98937135 100644 --- a/sentry-graphql-22/build.gradle.kts +++ b/sentry-graphql-22/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-graphql-core/build.gradle.kts b/sentry-graphql-core/build.gradle.kts index 7869fb0cb34..f2245e10fd2 100644 --- a/sentry-graphql-core/build.gradle.kts +++ b/sentry-graphql-core/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-graphql/build.gradle.kts b/sentry-graphql/build.gradle.kts index 772bcb03923..83d766e62d6 100644 --- a/sentry-graphql/build.gradle.kts +++ b/sentry-graphql/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-jcache/build.gradle.kts b/sentry-jcache/build.gradle.kts index 1e6fc567fdd..368b0373f2e 100644 --- a/sentry-jcache/build.gradle.kts +++ b/sentry-jcache/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-kotlin-extensions/build.gradle.kts b/sentry-kotlin-extensions/build.gradle.kts index 79332d18b80..9f7981f4f0a 100644 --- a/sentry-kotlin-extensions/build.gradle.kts +++ b/sentry-kotlin-extensions/build.gradle.kts @@ -14,8 +14,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-ktor-client/build.gradle.kts b/sentry-ktor-client/build.gradle.kts index c0ca7dac26b..0e9167025f1 100644 --- a/sentry-ktor-client/build.gradle.kts +++ b/sentry-ktor-client/build.gradle.kts @@ -15,8 +15,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } kotlin { explicitApi() } diff --git a/sentry-launchdarkly-server/build.gradle.kts b/sentry-launchdarkly-server/build.gradle.kts index 49dec717830..a9d99856244 100644 --- a/sentry-launchdarkly-server/build.gradle.kts +++ b/sentry-launchdarkly-server/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-okhttp/build.gradle.kts b/sentry-okhttp/build.gradle.kts index c9979ad6d37..b2c49cef955 100644 --- a/sentry-okhttp/build.gradle.kts +++ b/sentry-okhttp/build.gradle.kts @@ -15,8 +15,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } kotlin { explicitApi() } diff --git a/sentry-openfeature/build.gradle.kts b/sentry-openfeature/build.gradle.kts index 8220d7e6a67..74a3da106d8 100644 --- a/sentry-openfeature/build.gradle.kts +++ b/sentry-openfeature/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-quartz/build.gradle.kts b/sentry-quartz/build.gradle.kts index 3a3fbaec2e9..af45a6c3754 100644 --- a/sentry-quartz/build.gradle.kts +++ b/sentry-quartz/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-reactor/build.gradle.kts b/sentry-reactor/build.gradle.kts index 403f1c4e6f2..077eef74f76 100644 --- a/sentry-reactor/build.gradle.kts +++ b/sentry-reactor/build.gradle.kts @@ -16,8 +16,8 @@ tasks.named("compileJava") { options.release.set(17) } tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-samples/sentry-samples-spring-7/build.gradle.kts b/sentry-samples/sentry-samples-spring-7/build.gradle.kts index 83017cba374..b8cafa4d6a6 100644 --- a/sentry-samples/sentry-samples-spring-7/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-7/build.gradle.kts @@ -54,7 +54,7 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts index 86ae3560d22..015e92d3d0e 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts @@ -18,8 +18,8 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts index b8f4cf762a4..88fa5c41a9c 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts @@ -18,8 +18,8 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts index 8e9d87bbf24..46fe530e898 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts @@ -19,8 +19,8 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts index bad23b8167a..886d216ac5b 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts @@ -18,8 +18,8 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts index 6b1f3d91770..b50f73f9866 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts @@ -37,7 +37,7 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts index 7d83c62b2b9..4d7558975a5 100644 --- a/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts @@ -18,8 +18,8 @@ tasks.withType().configureEach { // skip metadata version check, as Spring 7 / Spring Boot 4 is // compiled against a newer version of Kotlin compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check") - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } } diff --git a/sentry-servlet-jakarta/build.gradle.kts b/sentry-servlet-jakarta/build.gradle.kts index 1c445b61360..a2e3d80a973 100644 --- a/sentry-servlet-jakarta/build.gradle.kts +++ b/sentry-servlet-jakarta/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-servlet/build.gradle.kts b/sentry-servlet/build.gradle.kts index a323c040ce8..9f978c461bf 100644 --- a/sentry-servlet/build.gradle.kts +++ b/sentry-servlet/build.gradle.kts @@ -13,8 +13,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-spring-boot-4-starter/build.gradle.kts b/sentry-spring-boot-4-starter/build.gradle.kts index fca672dac9d..8053c1d239f 100644 --- a/sentry-spring-boot-4-starter/build.gradle.kts +++ b/sentry-spring-boot-4-starter/build.gradle.kts @@ -17,8 +17,8 @@ tasks.named("compileJava") { options.release.set(17) } tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-spring-boot-4/build.gradle.kts b/sentry-spring-boot-4/build.gradle.kts index 26524b4f81e..f05d9aa4c89 100644 --- a/sentry-spring-boot-4/build.gradle.kts +++ b/sentry-spring-boot-4/build.gradle.kts @@ -22,7 +22,7 @@ tasks.named("compileJava") { options.release.set(17) } tasks.named("compileKotlin") { compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) - languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9) + languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0) freeCompilerArgs.add("-Xjsr305=strict") } } diff --git a/sentry-spring-boot-jakarta/build.gradle.kts b/sentry-spring-boot-jakarta/build.gradle.kts index 4fd584e8bb5..2126607d098 100644 --- a/sentry-spring-boot-jakarta/build.gradle.kts +++ b/sentry-spring-boot-jakarta/build.gradle.kts @@ -20,8 +20,8 @@ tasks.named("compileJava") { options.release.set(17) } tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-spring-boot-starter-jakarta/build.gradle.kts b/sentry-spring-boot-starter-jakarta/build.gradle.kts index 92cc97b240c..42792dee59f 100644 --- a/sentry-spring-boot-starter-jakarta/build.gradle.kts +++ b/sentry-spring-boot-starter-jakarta/build.gradle.kts @@ -17,8 +17,8 @@ tasks.named("compileJava") { options.release.set(17) } tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-spring-boot-starter/build.gradle.kts b/sentry-spring-boot-starter/build.gradle.kts index c78113f363d..cd50b73310a 100644 --- a/sentry-spring-boot-starter/build.gradle.kts +++ b/sentry-spring-boot-starter/build.gradle.kts @@ -12,8 +12,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-spring-boot/build.gradle.kts b/sentry-spring-boot/build.gradle.kts index 02a7b508225..8eafba4bd97 100644 --- a/sentry-spring-boot/build.gradle.kts +++ b/sentry-spring-boot/build.gradle.kts @@ -16,8 +16,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } // Spring scans the integration test apps' own bytecode with its repackaged ASM at startup, and diff --git a/sentry-spring-jakarta/build.gradle.kts b/sentry-spring-jakarta/build.gradle.kts index ee9b057ec6e..6f76c7e6267 100644 --- a/sentry-spring-jakarta/build.gradle.kts +++ b/sentry-spring-jakarta/build.gradle.kts @@ -18,8 +18,8 @@ plugins { tasks.named("compileJava") { options.release.set(17) } kotlin { - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict") } diff --git a/sentry-spring/build.gradle.kts b/sentry-spring/build.gradle.kts index 52ed26cce17..fc36bd555fa 100644 --- a/sentry-spring/build.gradle.kts +++ b/sentry-spring/build.gradle.kts @@ -15,8 +15,8 @@ plugins { tasks.named("compileKotlin") { compilerOptions.jvmTarget = JvmTarget.JVM_11 - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { diff --git a/sentry-test-support/build.gradle.kts b/sentry-test-support/build.gradle.kts index 2539beccb5f..32562c3fdb9 100644 --- a/sentry-test-support/build.gradle.kts +++ b/sentry-test-support/build.gradle.kts @@ -7,8 +7,8 @@ plugins { } tasks.withType().configureEach { - compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 - compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 + compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 + compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 } dependencies { From 9c0e0913a6c789958077f65be5fc26161e3bb662 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 6 Nov 2026 09:39:20 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bbc3ed4d50..5e55c2f7900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Breaking Changes - The SDK is now compiled for Java 11 instead of Java 8. JVM applications need Java 11 or newer ([#6459](https://github.com/getsentry/sentry-java/pull/6459)) +- Kotlin applications need Kotlin 1.9 or newer. The SDK is built with Kotlin 2.4 for language and API version 2.0 (previously 1.9), and its Kotlin modules depend on `kotlin-stdlib` 2.0.21 (previously 1.9.24) ([#6487](https://github.com/getsentry/sentry-java/pull/6487)) - Default trace context status to `ok` when an active span has no explicit status ([#6418](https://github.com/getsentry/sentry-java/pull/6418)) - Remove the deprecated user feedback APIs ([#6337](https://github.com/getsentry/sentry-java/pull/6337)) - `UserFeedback` and `Sentry.captureUserFeedback(...)`: use `Sentry.feedback().capture(...)` with `io.sentry.protocol.Feedback` instead From 9834fecfdee02c96bcd75c8dda9cc678a6877ac0 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 6 Nov 2026 10:45:10 +0100 Subject: [PATCH 3/3] build: Keep Kotlin module names without the group prefix KGP 2.4 prefixes the Kotlin module name with the group, e.g. io.sentry:sentry-android-fragment_release. The compiler writes the .kotlin_module file with an underscore instead of the colon, but R8 writes the entry again from the module name, colon included, and app bundles reject it. That broke bundleRelease of the size test app. Pin the module name to the project name, which restores the module file names 8.x shipped. Co-Authored-By: Claude Opus 5.5 --- .../io/sentry/gradle/JdkTargetConvention.kt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/build-logic/src/main/kotlin/io/sentry/gradle/JdkTargetConvention.kt b/build-logic/src/main/kotlin/io/sentry/gradle/JdkTargetConvention.kt index a46a2866df2..d504cceedb2 100644 --- a/build-logic/src/main/kotlin/io/sentry/gradle/JdkTargetConvention.kt +++ b/build-logic/src/main/kotlin/io/sentry/gradle/JdkTargetConvention.kt @@ -13,8 +13,10 @@ import org.gradle.api.tasks.compile.JavaCompile import org.gradle.jvm.toolchain.JavaLanguageVersion import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget +import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile /** The JDK every module compiles and tests with, whatever JDK runs Gradle. */ @@ -33,6 +35,7 @@ private val PUBLISHED_JAVA_VERSION = JavaVersion.VERSION_11 * archives are checked for it * - published Android modules main code targets Java 11 * - minSdk is set for Android libraries + * - Kotlin module names stay the project name */ class JdkTargetConvention : Plugin { override fun apply(project: Project) { @@ -98,6 +101,36 @@ class JdkTargetConvention : Plugin { listOf("com.android.library", "com.android.application").forEach { pluginId -> project.plugins.withId(pluginId) { project.targetBuildJdkForUnitTests() } } + + project.keepKotlinModuleNameWithoutGroup() + } + + /** + * KGP 2.4 prefixes the Kotlin module name with the group, e.g. `io.sentry:sentry-okhttp`. R8 copies + * that name into the names of the `.kotlin_module` entries it writes under `META-INF`, and app + * bundles reject the colon, so the module name stays the project name, as before KGP 2.4. + */ + private fun Project.keepKotlinModuleNameWithoutGroup() { + val moduleName = name + plugins.withId("org.jetbrains.kotlin.jvm") { + extensions.getByType(KotlinJvmProjectExtension::class.java).compilerOptions.moduleName.set( + moduleName + ) + } + plugins.withId("org.jetbrains.kotlin.android") { + extensions.getByType(KotlinAndroidProjectExtension::class.java).compilerOptions.moduleName.set( + moduleName + ) + } + plugins.withId("org.jetbrains.kotlin.multiplatform") { + val targets = extensions.getByType(KotlinMultiplatformExtension::class.java).targets + targets.withType(KotlinJvmTarget::class.java).configureEach { + compilerOptions.moduleName.set(moduleName) + } + targets.withType(KotlinAndroidTarget::class.java).configureEach { + compilerOptions.moduleName.set(moduleName) + } + } } private fun Project.minSdk(): Int =