Skip to content

Commit

Permalink
Update Kotlin, Compose, KSP
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-the-edwards committed Dec 16, 2024
1 parent 0a219dc commit ad894ae
Show file tree
Hide file tree
Showing 39 changed files with 220 additions and 216 deletions.
18 changes: 0 additions & 18 deletions artifacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@
"javaVersion": 8,
"publicationName": "iosSimulatorArm64"
},
{
"gradlePath": ":workflow-core",
"group": "com.squareup.workflow1",
"artifactId": "workflow-core-iosx64",
"description": "Workflow Core",
"packaging": "klib",
"javaVersion": 8,
"publicationName": "iosX64"
},
{
"gradlePath": ":workflow-core",
"group": "com.squareup.workflow1",
Expand Down Expand Up @@ -89,15 +80,6 @@
"javaVersion": 8,
"publicationName": "iosSimulatorArm64"
},
{
"gradlePath": ":workflow-runtime",
"group": "com.squareup.workflow1",
"artifactId": "workflow-runtime-iosx64",
"description": "Workflow Runtime",
"packaging": "klib",
"javaVersion": 8,
"publicationName": "iosX64"
},
{
"gradlePath": ":workflow-runtime",
"group": "com.squareup.workflow1",
Expand Down
2 changes: 1 addition & 1 deletion build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
// Hardcoded as this is upstream of the version catalog. Keep this in sync with that.
kotlin("jvm") version "1.9.10" apply false
kotlin("jvm") version "1.9.24" apply false
}

dependencyResolutionManagement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package com.squareup.workflow1.buildsrc

import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests

fun KotlinMultiplatformExtension.iosWithSimulatorArm64(target: Project) {
ios()
fun KotlinMultiplatformExtension.iosWithSimulatorArm64() {
// iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets.getByName("iosSimulatorArm64Main") {
it.dependsOn(sourceSets.getByName("iosMain"))
it.dependsOn(sourceSets.getByName("iosArm64Main"))
}
sourceSets.getByName("iosSimulatorArm64Test") {
it.dependsOn(sourceSets.getByName("iosTest"))
it.dependsOn(sourceSets.getByName("iosArm64Test"))
}
}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ tasks.register<Copy>("siteDokka") {
// Copy the files instead of configuring a different output directory on the dokka task itself
// since the default output directories disambiguate between different types of outputs, and our
// custom directory doesn't.
from(buildDir.resolve("dokka/htmlMultiModule/workflow"))
into(buildDir.resolve("dokka/workflow"))
from(layout.buildDirectory.file("dokka/htmlMultiModule/workflow"))
into(layout.buildDirectory.file("dokka/workflow"))
}
58 changes: 30 additions & 28 deletions dependencies/classpath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ com.google.code.findbugs:jsr305:3.0.2
com.google.code.gson:gson:2.8.9
com.google.crypto.tink:tink:1.7.0
com.google.dagger:dagger:2.28.3
com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.10-1.0.13
com.google.devtools.ksp:symbol-processing-api:1.9.24-1.0.20
com.google.devtools.ksp:symbol-processing-common-deps:1.9.24-1.0.20
com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.24-1.0.20
com.google.errorprone:error_prone_annotations:2.11.0
com.google.flatbuffers:flatbuffers-java:1.12.0
com.google.guava:failureaccess:1.0.1
Expand Down Expand Up @@ -135,36 +137,36 @@ org.jdom:jdom2:2.0.6
org.jetbrains.dokka:dokka-core:1.9.10
org.jetbrains.dokka:dokka-gradle-plugin:1.9.10
org.jetbrains.intellij.deps:trove4j:1.0.20200330
org.jetbrains.kotlin:kotlin-android-extensions:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-build-tools-api:1.9.10
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.10
org.jetbrains.kotlin:kotlin-compiler-runner:1.9.10
org.jetbrains.kotlin:kotlin-daemon-client:1.9.10
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10
org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.10
org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.9.10
org.jetbrains.kotlin:kotlin-native-utils:1.9.10
org.jetbrains.kotlin:kotlin-project-model:1.9.10
org.jetbrains.kotlin:kotlin-android-extensions:1.9.24
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-build-tools-api:1.9.24
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.24
org.jetbrains.kotlin:kotlin-compiler-runner:1.9.24
org.jetbrains.kotlin:kotlin-daemon-client:1.9.24
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugin-annotations:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24
org.jetbrains.kotlin:kotlin-gradle-plugins-bom:1.9.24
org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.9.24
org.jetbrains.kotlin:kotlin-native-utils:1.9.24
org.jetbrains.kotlin:kotlin-project-model:1.9.24
org.jetbrains.kotlin:kotlin-reflect:1.9.10
org.jetbrains.kotlin:kotlin-scripting-common:1.9.10
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.10
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.10
org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.10
org.jetbrains.kotlin:kotlin-serialization:1.9.10
org.jetbrains.kotlin:kotlin-scripting-common:1.9.24
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.9.24
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.9.24
org.jetbrains.kotlin:kotlin-scripting-jvm:1.9.24
org.jetbrains.kotlin:kotlin-serialization:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-tooling-core:1.9.10
org.jetbrains.kotlin:kotlin-util-io:1.9.10
org.jetbrains.kotlin:kotlin-util-klib:1.9.10
org.jetbrains.kotlin:kotlin-tooling-core:1.9.24
org.jetbrains.kotlin:kotlin-util-io:1.9.24
org.jetbrains.kotlin:kotlin-util-klib:1.9.24
org.jetbrains.kotlinx:binary-compatibility-validator:0.13.2
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.3
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ androidx-activity = "1.6.1"
androidx-appcompat = "1.6.1"
androidx-benchmark = "1.2.3"
androidx-cardview = "1.0.0"
androidx-compose-compiler = "1.5.3"
androidx-compose-compiler = "1.5.14"
# see https://developer.android.com/jetpack/compose/bom/bom-mapping
androidx-compose-bom = "2023.01.00"
androidx-compose-bom = "2023.09.02"
androidx-constraintlayout = "2.1.4"
androidx-core = "1.12.0"
androidx-fragment = "1.3.6"
Expand All @@ -42,7 +42,7 @@ dependencyGuard = "0.4.3"

google-accompanist = "0.18.0"
google-dagger = "2.40.5"
google-ksp = "1.9.10-1.0.13"
google-ksp = "1.9.24-1.0.20"
google-material = "1.4.0"

groovy = "3.0.9"
Expand All @@ -53,7 +53,7 @@ kgx = "0.1.12"
kotest = "5.1.0"
# Keep this in sync with what is hard-coded in build-logic/settings.gradle.kts as that is upstream
# of loading the library versions from this file but should be the same.
kotlin = "1.9.10"
kotlin = "1.9.24"

kotlinx-binary-compatibility = "0.13.2"
kotlinx-coroutines = "1.7.3"
Expand Down
9 changes: 4 additions & 5 deletions internal-testing-utils/dependencies/runtimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains:annotations:13.0
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.animation.with
import androidx.compose.animation.togetherWith
import androidx.compose.foundation.layout.Box
import androidx.compose.material.Button
import androidx.compose.material.Text
Expand Down Expand Up @@ -77,7 +77,7 @@ private fun AnimatedCounter(
AnimatedContent(
targetState = counterValue,
transitionSpec = {
(slideInVertically() + fadeIn() with slideOutVertically() + fadeOut())
((slideInVertically() + fadeIn()).togetherWith(slideOutVertically() + fadeOut()))
.using(SizeTransform(clip = false))
}
) { content(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.compose.foundation.clickable
import androidx.compose.foundation.gestures.forEachGesture
import androidx.compose.foundation.gestures.awaitEachGesture
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -148,14 +148,15 @@ private fun launchSample(
startActivity(context, intent, options)
}

private fun Modifier.disableTouchInput(): Modifier = pointerInput(Unit) {
forEachGesture {
awaitPointerEventScope {
awaitPointerEvent(Initial).let { event ->
event.changes.forEach { change ->
if (change.pressed != change.previousPressed) change.consume()
private fun Modifier.disableTouchInput(): Modifier =
then(
pointerInput(Unit) {
awaitEachGesture {
awaitPointerEvent(Initial).let { event ->
event.changes.forEach { change ->
if (change.pressed != change.previousPressed) change.consume()
}
}
}
}
}
}
)
10 changes: 5 additions & 5 deletions trace-encoder/dependencies/runtimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ com.squareup.moshi:moshi-adapters:1.15.0
com.squareup.moshi:moshi:1.15.0
com.squareup.okio:okio-jvm:3.3.0
com.squareup.okio:okio:3.3.0
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
com.squareup.okio:okio-jvm:3.3.0
com.squareup.okio:okio:3.3.0
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
Expand Down
10 changes: 5 additions & 5 deletions workflow-config/config-jvm/dependencies/runtimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
com.squareup.okio:okio-jvm:3.3.0
com.squareup.okio:okio:3.3.0
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
Expand Down
2 changes: 1 addition & 1 deletion workflow-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
kotlin {
val targets = project.findProperty("workflow.targets") ?: "kmp"
if (targets == "kmp" || targets == "ios") {
iosWithSimulatorArm64(project)
iosWithSimulatorArm64()
}
if (targets == "kmp" || targets == "jvm") {
jvm { withJava() }
Expand Down
9 changes: 4 additions & 5 deletions workflow-core/dependencies/jsRuntimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
com.squareup.okio:okio-js:3.3.0
com.squareup.okio:okio:3.3.0
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-dom-api-compat:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-js:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-dom-api-compat:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-js:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains.kotlin:kotlinx-atomicfu-runtime:1.8.20
org.jetbrains.kotlinx:atomicfu-js:0.21.0
org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
org.jetbrains:annotations:13.0
8 changes: 4 additions & 4 deletions workflow-core/dependencies/jvmRuntimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
com.squareup.okio:okio-jvm:3.3.0
com.squareup.okio:okio:3.3.0
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
Expand Down
10 changes: 5 additions & 5 deletions workflow-core/dependencies/runtimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
com.squareup.okio:okio-jvm:3.3.0
com.squareup.okio:okio:3.3.0
org.jetbrains.kotlin:kotlin-bom:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
org.jetbrains.kotlin:kotlin-stdlib:1.9.10
org.jetbrains.kotlin:kotlin-bom:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-common:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.24
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
org.jetbrains.kotlin:kotlin-stdlib:1.9.24
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private class EmitWorkerOutputAction<P, S, O>(
private val output: O,
) : WorkflowAction<P, S, O>() {
override val debuggingName: String
get() = CommonKClassTypeNamer.uniqueName(EmitWorkerOutputAction::class) +
get() = commonUniqueClassName(EmitWorkerOutputAction::class) +
"(worker=$worker, key=$renderKey)"

override fun Updater.apply() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract class WorkflowAction<in PropsT, StateT, out OutputT> {
* The name to use for debugging. This is handy for logging and is used by the default
* [toString] implementation provided here.
*/
public open val debuggingName: String = CommonKClassTypeNamer.uniqueName(this::class)
public open val debuggingName: String = commonUniqueClassName(this::class)

/**
* The context for calls to [WorkflowAction.apply]. Allows the action to read and change the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed class WorkflowIdentifierType {
val kClass: KClass<*>? = null,
) : WorkflowIdentifierType() {
public constructor(kClass: KClass<*>) : this(
CommonKClassTypeNamer.uniqueName(kClass),
commonUniqueClassName(kClass),
kClass
)
}
Expand All @@ -46,6 +46,4 @@ public sealed class WorkflowIdentifierType {
}
}

internal expect object CommonKClassTypeNamer {
public fun uniqueName(kClass: KClass<*>): String
}
internal expect fun commonUniqueClassName(kClass: KClass<*>): String
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ internal class WorkflowIdentifierTest {
) : Workflow<Nothing, Nothing, Nothing>, ImpostorWorkflow {
override val realIdentifier: WorkflowIdentifier = proxied.identifier
override fun describeRealIdentifier(): String =
"TestImpostor1(${CommonKClassTypeNamer.uniqueName(proxied::class)})"
"TestImpostor1(${commonUniqueClassName(proxied::class)})"
override fun asStatefulWorkflow(): StatefulWorkflow<Nothing, *, Nothing, Nothing> =
throw NotImplementedError()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.squareup.workflow1

import kotlin.reflect.KClass

internal actual fun commonUniqueClassName(kClass: KClass<*>): String {
return kClass.qualifiedName ?: kClass.toString()
}
Loading

0 comments on commit ad894ae

Please sign in to comment.