Skip to content

Deps: Update Kotlin to 2.1.21 #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3d0f8f1
Update Kotlin and Compose version
buenaflor May 16, 2025
5938aac
Missing newline
buenaflor May 16, 2025
39775b7
Update
buenaflor May 16, 2025
ef0aa9c
Update deprecations
buenaflor May 16, 2025
8db72ee
Merge branch 'main' into deps/upgrade-kotlin
buenaflor Jun 25, 2025
530cdf0
Fix K2 compiler issue
buenaflor Jun 27, 2025
305871a
Formatting
buenaflor Jun 27, 2025
cd22321
Fix test
buenaflor Jun 27, 2025
c893986
Update
buenaflor Jun 27, 2025
c856bd6
Update
buenaflor Jun 27, 2025
1e18595
Formatting
buenaflor Jun 27, 2025
23b0ea4
Formatting
buenaflor Jun 27, 2025
e0b6d23
Fix Java 11 config
buenaflor Jun 27, 2025
eecc548
Bump test lib versions
buenaflor Jun 27, 2025
2115539
Versions
buenaflor Jun 27, 2025
1f1a4f6
Java config
buenaflor Jun 27, 2025
e611075
Update
buenaflor Jun 27, 2025
9d5ba95
Merge branch 'main' into deps/upgrade-kotlin
buenaflor Jun 27, 2025
f8c356c
Enable debug temporarily
buenaflor Jun 27, 2025
43ee73a
Revert
buenaflor Jun 27, 2025
0223f5c
Update
buenaflor Jun 27, 2025
fdf6fea
Update
buenaflor Jun 27, 2025
e9c65fd
Update
buenaflor Jun 27, 2025
a5e2d88
Line end
buenaflor Jun 28, 2025
2b5af1f
Formatting
buenaflor Jun 28, 2025
c835f21
Merge branch 'main' into deps/upgrade-kotlin
buenaflor Jun 30, 2025
e0f9abe
Merge branch 'main' into deps/upgrade-kotlin
buenaflor Jul 1, 2025
31e24c6
Add toolchain to java block
buenaflor Jul 4, 2025
0cbb440
Update CHANGELOG
buenaflor Jul 4, 2025
737dade
Update publication
buenaflor Jul 16, 2025
06a6695
Update
buenaflor Jul 17, 2025
b1d21e5
Update
buenaflor Jul 17, 2025
d75f8f2
Merge branch 'main' into deps/upgrade-kotlin
buenaflor Jul 17, 2025
0a7ac5a
Update `distZip` task to use the locally published artifacts via `pub…
buenaflor Jul 18, 2025
1915b7a
Update CHANGELOG.md
buenaflor Jul 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ plugins {
id(Config.dokka).version(Config.dokkaVersion)
kotlin(Config.multiplatform).version(Config.kotlinVersion).apply(false)
kotlin(Config.cocoapods).version(Config.kotlinVersion).apply(false)
id(Config.jetpackCompose).version(Config.composeVersion).apply(false)
id(Config.jetpackCompose).version(Config.composePluginVersion).apply(false)
id(Config.kotlinCompose).version(Config.kotlinVersion).apply(false)
id(Config.androidGradle).version(Config.agpVersion).apply(false)
id(Config.BuildPlugins.buildConfig).version(Config.BuildPlugins.buildConfigVersion).apply(false)
kotlin(Config.kotlinSerializationPlugin).version(Config.kotlinVersion).apply(false)
Expand Down
5 changes: 3 additions & 2 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
object Config {
val agpVersion = "7.4.2"
val kotlinVersion = "1.9.23"
val composeVersion = "1.6.1"
val kotlinVersion = "2.1.21"
val composePluginVersion = "1.8.0"
val gradleMavenPublishPluginVersion = "0.18.0"

val multiplatform = "multiplatform"
val cocoapods = "native.cocoapods"
val jetpackCompose = "org.jetbrains.compose"
val kotlinCompose = "org.jetbrains.kotlin.plugin.compose"
val gradleMavenPublishPlugin = "com.vanniktech.maven.publish"
val androidGradle = "com.android.library"
val kotlinSerializationPlugin = "plugin.serialization"
Expand Down
2 changes: 2 additions & 0 deletions sentry-kotlin-multiplatform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ kotlin {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
optIn("kotlinx.cinterop.UnsafeNumber")
optIn("kotlin.experimental.ExperimentalNativeApi")
// TODO(buenaflor): we get compiler errors with k2 so right now don't use it
languageVersion = "1.9"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ internal fun wrapUnhandledExceptionHook(hook: (Throwable) -> Unit) {
prevHook.value?.invoke(it)
terminateWithUnhandledException(it)
}
prevHook.value = setUnhandledExceptionHook(wrappedHook.freeze())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

freeze() is deprecated / not needed anymore in this kotlin version

prevHook.value = setUnhandledExceptionHook(wrappedHook)
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public abstract class SentryBaseEvent(
* This is not thread-safe.
*/
public var contexts: Map<String, Any> = mapOf()
internal set
Comment on lines 46 to -47
Copy link
Contributor Author

@buenaflor buenaflor Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal set was what messed up the K2 compiler when compiling for native targets. admittedly I have no idea why but it compiles without it 😅


/**
* A mutable map of breadcrumbs that led to this event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
}

Expand All @@ -25,9 +26,7 @@ tasks.withType<KotlinCompile> {
}

kotlin {
jvm {
withJava()
}
jvm()
sourceSets {
val jvmMain by getting {
dependencies {
Expand Down
5 changes: 2 additions & 3 deletions sentry-samples/kmp-app-spm/desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
}

Expand All @@ -25,9 +26,7 @@ tasks.withType<KotlinCompile> {
}

kotlin {
jvm {
withJava()
}
jvm()
sourceSets {
val jvmMain by getting {
dependencies {
Expand Down
Loading