Skip to content

Commit

Permalink
Update to Kotlin 2.0.20 (#1605)
Browse files Browse the repository at this point in the history
**Highlights**

- Switch to stdlib `Uuid` implementation
- Rest is just busywork in builds
  • Loading branch information
ZacSweers committed Aug 27, 2024
1 parent 8f0353f commit 4c1cbee
Show file tree
Hide file tree
Showing 34 changed files with 242 additions and 429 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Changelog
**Unreleased**
--------------

- Update to Kotlin `2.0.20`.
- **Change**: Switch to stdlib's implementation of `Uuid`. This release now requires Kotlin `2.0.20` or later.
- **Behavior change**: `presenterTestOf` and `Presenter.test` have a new optional `moleculeFlowTransformer` parameter that allows for advanced filtering of the `Flow` returned out of the underlying `moleculeFlow`. By default, this now runs a `distinctUntilChanged` operator.
- Build against KSP `2.0.20-1.0.24`.

0.23.1
------
Expand Down
3 changes: 1 addition & 2 deletions backstack/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
Expand Down Expand Up @@ -57,7 +57,6 @@ kotlin {
api(libs.kotlinx.immutable)
api(projects.circuitRuntimeScreen)
implementation(libs.compose.runtime.saveable)
implementation(libs.uuid)
}
}
commonTest {
Expand Down
2 changes: 0 additions & 2 deletions backstack/dependencies/androidReleaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ androidx.savedstate:savedstate
androidx.startup:startup-runtime
androidx.tracing:tracing
androidx.versionedparcelable:versionedparcelable
com.benasher44:uuid-jvm
com.benasher44:uuid
com.google.guava:listenablefuture
org.jetbrains.compose.runtime:runtime-saveable
org.jetbrains.compose.runtime:runtime
Expand Down
2 changes: 0 additions & 2 deletions backstack/dependencies/jvmRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ androidx.lifecycle:lifecycle-runtime-desktop
androidx.lifecycle:lifecycle-runtime
androidx.lifecycle:lifecycle-viewmodel-desktop
androidx.lifecycle:lifecycle-viewmodel
com.benasher44:uuid-jvm
com.benasher44:uuid
org.jetbrains.androidx.lifecycle:lifecycle-common
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import androidx.compose.runtime.saveable.listSaver
import androidx.compose.runtime.saveable.mapSaver
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.snapshots.Snapshot
import com.benasher44.uuid.uuid4
import com.slack.circuit.runtime.screen.PopResult
import com.slack.circuit.runtime.screen.Screen
import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.channels.Channel
Expand Down Expand Up @@ -156,7 +157,7 @@ internal constructor(
public data class Record(
override val screen: Screen,
val args: Map<String, Any?> = emptyMap(),
override val key: String = uuid4().toString(),
@OptIn(ExperimentalUuidApi::class) override val key: String = Uuid.random().toString(),
) : BackStack.Record {
/**
* A [Channel] of pending results. Note we use this instead of a [CompletableDeferred] because
Expand Down
5 changes: 1 addition & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,7 @@ subprojects {

pluginManager.withPlugin("org.jetbrains.compose") {
apply(plugin = "org.jetbrains.kotlin.plugin.compose")
configure<ComposeCompilerGradlePluginExtension> {
enableStrongSkippingMode = true
includeSourceInformation = true
}
configure<ComposeCompilerGradlePluginExtension> { includeSourceInformation = true }
}

pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
Expand Down
3 changes: 1 addition & 2 deletions circuit-foundation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -60,7 +60,6 @@ kotlin {
api(projects.circuitRuntimeUi)
api(projects.circuitRetained)
api(libs.compose.ui)
implementation(libs.uuid)
}
}
androidMain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ androidx.savedstate:savedstate
androidx.startup:startup-runtime
androidx.tracing:tracing
androidx.versionedparcelable:versionedparcelable
com.benasher44:uuid-jvm
com.benasher44:uuid
com.google.guava:listenablefuture
org.jetbrains.compose.foundation:foundation
org.jetbrains.compose.runtime:runtime-saveable
Expand Down
2 changes: 0 additions & 2 deletions circuit-foundation/dependencies/jvmRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ androidx.lifecycle:lifecycle-runtime-desktop
androidx.lifecycle:lifecycle-runtime
androidx.lifecycle:lifecycle-viewmodel-desktop
androidx.lifecycle:lifecycle-viewmodel
com.benasher44:uuid-jvm
com.benasher44:uuid
org.jetbrains.androidx.lifecycle:lifecycle-common
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import com.benasher44.uuid.uuid4
import com.slack.circuit.backstack.BackStack
import com.slack.circuit.runtime.GoToNavigator
import com.slack.circuit.runtime.Navigator
import com.slack.circuit.runtime.screen.PopResult
import com.slack.circuit.runtime.screen.Screen
import kotlin.reflect.KClass
import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid
import kotlinx.coroutines.CoroutineScope

/**
Expand Down Expand Up @@ -104,7 +105,7 @@ public fun <T : PopResult> rememberAnsweringNavigator(
}

// Key for the resultKey, so we can track who owns this requested result
val key = rememberSaveable { uuid4().toString() }
val key = rememberSaveable { @OptIn(ExperimentalUuidApi::class) Uuid.random().toString() }

// Current top record of the navigator
val currentTopRecordKey by remember { derivedStateOf { currentBackStack.topRecord!!.key } }
Expand Down
2 changes: 1 addition & 1 deletion circuit-overlay/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 1 addition & 1 deletion circuit-retained/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2023 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 1 addition & 1 deletion circuit-runtime-presenter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 1 addition & 1 deletion circuit-runtime-screen/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 1 addition & 1 deletion circuit-runtime-ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 1 addition & 1 deletion circuit-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 1 addition & 1 deletion circuit-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
2 changes: 0 additions & 2 deletions circuit-test/dependencies/androidReleaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ app.cash.molecule:molecule-runtime-android
app.cash.molecule:molecule-runtime
app.cash.turbine:turbine-jvm
app.cash.turbine:turbine
com.benasher44:uuid-jvm
com.benasher44:uuid
com.google.guava:listenablefuture
org.jetbrains.compose.foundation:foundation
org.jetbrains.compose.runtime:runtime-saveable
Expand Down
2 changes: 0 additions & 2 deletions circuit-test/dependencies/jvmRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ app.cash.molecule:molecule-runtime-jvm
app.cash.molecule:molecule-runtime
app.cash.turbine:turbine-jvm
app.cash.turbine:turbine
com.benasher44:uuid-jvm
com.benasher44:uuid
org.jetbrains.androidx.lifecycle:lifecycle-common
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
Expand Down
2 changes: 1 addition & 1 deletion circuitx/effects/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2024 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ androidx.savedstate:savedstate
androidx.startup:startup-runtime
androidx.tracing:tracing
androidx.versionedparcelable:versionedparcelable
com.benasher44:uuid-jvm
com.benasher44:uuid
com.google.guava:listenablefuture
org.jetbrains.compose.foundation:foundation
org.jetbrains.compose.runtime:runtime-saveable
Expand Down
2 changes: 0 additions & 2 deletions circuitx/effects/dependencies/jvmRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ androidx.lifecycle:lifecycle-runtime-desktop
androidx.lifecycle:lifecycle-runtime
androidx.lifecycle:lifecycle-viewmodel-desktop
androidx.lifecycle:lifecycle-viewmodel
com.benasher44:uuid-jvm
com.benasher44:uuid
org.jetbrains.androidx.lifecycle:lifecycle-common
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
Expand Down
2 changes: 1 addition & 1 deletion circuitx/gesture-navigation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2023 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ androidx.savedstate:savedstate
androidx.startup:startup-runtime
androidx.tracing:tracing
androidx.versionedparcelable:versionedparcelable
com.benasher44:uuid-jvm
com.benasher44:uuid
com.google.guava:listenablefuture
org.jetbrains.compose.foundation:foundation
org.jetbrains.compose.material3:material3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ androidx.lifecycle:lifecycle-runtime-desktop
androidx.lifecycle:lifecycle-runtime
androidx.lifecycle:lifecycle-viewmodel-desktop
androidx.lifecycle:lifecycle-viewmodel
com.benasher44:uuid-jvm
com.benasher44:uuid
org.jetbrains.androidx.lifecycle:lifecycle-common
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
Expand Down
2 changes: 1 addition & 1 deletion circuitx/overlays/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (C) 2022 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ androidx.savedstate:savedstate
androidx.startup:startup-runtime
androidx.tracing:tracing
androidx.versionedparcelable:versionedparcelable
com.benasher44:uuid-jvm
com.benasher44:uuid
com.google.accompanist:accompanist-systemuicontroller
com.google.guava:listenablefuture
org.jetbrains.compose.foundation:foundation
Expand Down
2 changes: 0 additions & 2 deletions circuitx/overlays/dependencies/jvmRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ androidx.lifecycle:lifecycle-runtime-desktop
androidx.lifecycle:lifecycle-runtime
androidx.lifecycle:lifecycle-viewmodel-desktop
androidx.lifecycle:lifecycle-viewmodel
com.benasher44:uuid-jvm
com.benasher44:uuid
org.jetbrains.androidx.lifecycle:lifecycle-common
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose-desktop
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
Expand Down
9 changes: 3 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jdk = "22"
jvmTarget = "11"
publishedJvmTarget = "1.8"
kct = "0.5.1"
kotlin = "2.0.10"
kotlin = "2.0.20"
kotlinpoet = "1.18.1"
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.7.1"
ksp = "2.0.10-1.0.24"
ksp = "2.0.20-1.0.24"
ktfmt = "0.52"
ktor = "2.3.12"
leakcanary = "2.14"
Expand All @@ -46,7 +46,7 @@ paparazzi = "1.3.4"
picnic = "0.7.0"
robolectric = "4.13"
roborazzi = "1.26.0"
skie = "0.8.4"
skie = "0.9.0-RC.3"
spotless = "7.0.0.BETA2"
sqldelight = "2.0.2"
telephoto = "0.13.0"
Expand Down Expand Up @@ -273,9 +273,6 @@ testing-testParameterInjector = { module = "com.google.testparameterinjector:tes
truth = "com.google.truth:truth:1.4.4"
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }

# KMP UUID
uuid = "com.benasher44:uuid:0.8.4"

windowSizeClass = "dev.chrisbanes.material3:material3-window-size-class-multiplatform:0.5.0"

[bundles]
Expand Down
2 changes: 1 addition & 1 deletion internal-test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2023 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.agp.library)
Expand Down
Loading

0 comments on commit 4c1cbee

Please sign in to comment.