diff --git a/.github/workflows/kotlin.yml b/.github/workflows/kotlin.yml index b1fab7d2c2..51d9df206d 100644 --- a/.github/workflows/kotlin.yml +++ b/.github/workflows/kotlin.yml @@ -659,7 +659,7 @@ jobs: api-level: ${{ matrix.api-level }} prepare-task: prepareConnectedCheckShard${{matrix.shardNum}} # -x excludes tasks - test-task: connectedCheckShard${{matrix.shardNum}} -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-poetry:connectedCheck + test-task: connectedCheckShard${{matrix.shardNum}} -x :benchmarks:dungeon-benchmark:connectedAndroidTest -x :benchmarks:performance-poetry:complex-benchmark:connectedAndroidTest -x :benchmarks:performance-poetry:complex-poetry:connectedAndroidTest write-cache-key: androidTest-build-artifacts-${{matrix.shardNum}} restore-cache-key: main-build-artifacts failure-path-upload: '**/build/reports/androidTests/connected' @@ -690,7 +690,7 @@ jobs: api-level: ${{ matrix.api-level }} prepare-task: prepareConnectedCheckShard${{matrix.shardNum}} -Pworkflow.runtime=${{matrix.runtime}} # -x excludes tasks - test-task: connectedCheckShard${{matrix.shardNum}} -Pworkflow.runtime=${{matrix.runtime}} -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-poetry:connectedCheck + test-task: connectedCheckShard${{matrix.shardNum}} -Pworkflow.runtime=${{matrix.runtime}} -x :benchmarks:dungeon-benchmark:connectedAndroidTest -x :benchmarks:performance-poetry:complex-benchmark:connectedAndroidTest -x :benchmarks:performance-poetry:complex-poetry:connectedAndroidTest write-cache-key: androidTest-build-artifacts-${{matrix.shardNum}}-${{matrix.runtime}} restore-cache-key: main-build-artifacts failure-path-upload: '**/build/reports/androidTests/connected' diff --git a/artifacts.json b/artifacts.json index 705dcc1b98..428ea22ef6 100644 --- a/artifacts.json +++ b/artifacts.json @@ -53,6 +53,15 @@ "javaVersion": 8, "publicationName": "kotlinMultiplatform" }, + { + "gradlePath": ":workflow-runtime", + "group": "com.squareup.workflow1", + "artifactId": "workflow-runtime-android", + "description": "Workflow Runtime", + "packaging": "aar", + "javaVersion": 8, + "publicationName": "android" + }, { "gradlePath": ":workflow-runtime", "group": "com.squareup.workflow1", @@ -107,15 +116,6 @@ "javaVersion": 8, "publicationName": "kotlinMultiplatform" }, - { - "gradlePath": ":workflow-runtime-android", - "group": "com.squareup.workflow1", - "artifactId": "workflow-runtime-android", - "description": "Workflow Runtime Android", - "packaging": "aar", - "javaVersion": 8, - "publicationName": "maven" - }, { "gradlePath": ":workflow-rx2", "group": "com.squareup.workflow1", diff --git a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/shardConnectedChecks.kt b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/shardConnectedChecks.kt index 2b8ccc5d70..ce41b593d2 100644 --- a/build-logic/src/main/java/com/squareup/workflow1/buildsrc/shardConnectedChecks.kt +++ b/build-logic/src/main/java/com/squareup/workflow1/buildsrc/shardConnectedChecks.kt @@ -47,9 +47,12 @@ fun shardConnectedCheckTasks(target: Project) { // Calculate the cost of each project's tests val projectsWithTestCount = lazy(NONE) { target.subprojects - // Only Android projects can have these tasks. - // Use the KGP Android plugin instead of AGP since KGP has only one ID to look for. - .filter { it.plugins.hasPlugin("org.jetbrains.kotlin.android") } + .filter { + // Only Android projects can have these tasks. + // Use the KGP Android plugin instead of AGP since KGP has only one ID to look for. + it.plugins.hasPlugin("org.jetbrains.kotlin.android") || + it.plugins.hasPlugin("com.android.kotlin.multiplatform.library") + } .map { it to it.androidTestCost() } } @@ -58,7 +61,9 @@ fun shardConnectedCheckTasks(target: Project) { // outside the task configuration block so that it only happens once. val shardAssignments = projectsWithTestCount.shards() - val connectedTestName = "connectedCheck" + // We use connectedAndroidTest instead of connectedCheck since Android instrumented tests in KMP + // modules aren't included the latter, but they are in the former. + val connectedTestName = "connectedAndroidTest" shardAssignments.forEach { shard -> @@ -215,13 +220,16 @@ private val testAnnotationRegex = """@(?:org\.junit\.)?Test\s+""".toRegex() * * Each test function has a cost of 1. A project with 20 tests has a cost of 20. */ -private fun Project.androidTestCost(): Int { - - val androidTestSrc = file("src/androidTest/java") - - if (!androidTestSrc.exists()) return 0 - - return androidTestSrc +private fun Project.androidTestCost(): Int = + listOf( + // Android-only, non-KMP modules. + file("src/androidTest/java"), + // KMP modules with android targets. + file("src/androidDeviceTest/kotlin"), + ).sumOf { androidTestSrc -> + if (!androidTestSrc.exists()) return@sumOf 0 + + androidTestSrc .walkTopDown() .filter { it.isFile && it.extension == "kt" } .sumOf { file -> diff --git a/build.gradle.kts b/build.gradle.kts index 7ece3cfc2a..37ad3a500f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,7 +37,6 @@ apply(from = rootProject.file(".buildscript/binary-validation.gradle")) dependencies { dokka(project(":workflow-core")) dokka(project(":workflow-runtime")) - dokka(project(":workflow-runtime-android")) dokka(project(":workflow-rx2")) dokka(project(":workflow-testing")) dokka(project(":workflow-ui:compose")) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d9a95d9e4d..8176a8cbf6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -192,6 +192,7 @@ androidx-transition = { module = "androidx.transition:transition", version.ref = androidx-viewbinding = { module = "androidx.databinding:viewbinding", version.ref = "androidx-viewbinding" } +burst = { module = "app.cash.burst:burst", version.ref = "burst" } burst-plugin = { module = "app.cash.burst:burst-gradle-plugin", version.ref = "burst" } dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } diff --git a/settings.gradle.kts b/settings.gradle.kts index ced4e51458..4888917495 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -62,7 +62,6 @@ include( ":workflow-config:config-jvm", ":workflow-core", ":workflow-runtime", - ":workflow-runtime-android", ":workflow-rx2", ":workflow-testing", ":workflow-tracing", diff --git a/workflow-config/config-android/dependencies/releaseRuntimeClasspath.txt b/workflow-config/config-android/dependencies/releaseRuntimeClasspath.txt index aa339f76a8..4461d2b976 100644 --- a/workflow-config/config-android/dependencies/releaseRuntimeClasspath.txt +++ b/workflow-config/config-android/dependencies/releaseRuntimeClasspath.txt @@ -1,3 +1,58 @@ +androidx.activity:activity-ktx:1.7.0 +androidx.activity:activity:1.7.0 +androidx.annotation:annotation-experimental:1.4.1 +androidx.annotation:annotation-jvm:1.8.1 +androidx.annotation:annotation:1.8.1 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.autofill:autofill:1.0.0 +androidx.collection:collection-jvm:1.4.4 +androidx.collection:collection-ktx:1.4.4 +androidx.collection:collection:1.4.4 +androidx.compose.runtime:runtime-android:1.7.8 +androidx.compose.runtime:runtime-saveable-android:1.7.8 +androidx.compose.runtime:runtime-saveable:1.7.8 +androidx.compose.runtime:runtime:1.7.8 +androidx.compose.ui:ui-android:1.7.8 +androidx.compose.ui:ui-geometry-android:1.7.8 +androidx.compose.ui:ui-geometry:1.7.8 +androidx.compose.ui:ui-graphics-android:1.7.8 +androidx.compose.ui:ui-graphics:1.7.8 +androidx.compose.ui:ui-text-android:1.7.8 +androidx.compose.ui:ui-text:1.7.8 +androidx.compose.ui:ui-unit-android:1.7.8 +androidx.compose.ui:ui-unit:1.7.8 +androidx.compose.ui:ui-util-android:1.7.8 +androidx.compose.ui:ui-util:1.7.8 +androidx.compose:compose-bom:2025.03.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.core:core-ktx:1.12.0 +androidx.core:core:1.12.0 +androidx.customview:customview-poolingcontainer:1.0.0 +androidx.emoji2:emoji2:1.2.0 +androidx.graphics:graphics-path:1.0.1 +androidx.interpolator:interpolator:1.0.0 +androidx.lifecycle:lifecycle-common-jvm:2.8.7 +androidx.lifecycle:lifecycle-common:2.8.7 +androidx.lifecycle:lifecycle-livedata-core:2.8.7 +androidx.lifecycle:lifecycle-process:2.8.7 +androidx.lifecycle:lifecycle-runtime-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx:2.8.7 +androidx.lifecycle:lifecycle-runtime:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 +androidx.lifecycle:lifecycle-viewmodel:2.8.7 +androidx.profileinstaller:profileinstaller:1.3.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.startup:startup-runtime:1.1.1 +androidx.tracing:tracing:1.0.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +com.google.guava:listenablefuture:1.0 com.squareup.okio:okio-jvm:3.3.0 com.squareup.okio:okio:3.3.0 org.jetbrains.kotlin:kotlin-bom:2.1.21 @@ -5,6 +60,7 @@ org.jetbrains.kotlin:kotlin-stdlib-common:2.1.21 org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.21 org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21 org.jetbrains.kotlin:kotlin-stdlib:2.1.21 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0 diff --git a/workflow-runtime-android/README.md b/workflow-runtime-android/README.md deleted file mode 100644 index f6ede30c25..0000000000 --- a/workflow-runtime-android/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Module Workflow Runtime Android - -This module is an Android library that contains utilities to start a Workflow runtime that are -specific to Android components. This contains only the 'headless' components for Workflow on -Android; i.e. no UI concerns. - -See :workflow-ui:core-android for the complimentary helpers on Android that include UI concerns: -view model persistent, `WorkflowLayout`, etc. - -It also provides a place to include tests that verify behaviour of the runtime while using -Android specific dispatchers. diff --git a/workflow-runtime-android/api/workflow-runtime-android.api b/workflow-runtime-android/api/workflow-runtime-android.api deleted file mode 100644 index 4316d5d143..0000000000 --- a/workflow-runtime-android/api/workflow-runtime-android.api +++ /dev/null @@ -1,10 +0,0 @@ -public final class com/squareup/workflow1/android/AndroidRenderWorkflowKt { - public static final fun removeWorkflowState (Landroidx/lifecycle/SavedStateHandle;)V - public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; - public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/Object;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; - public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/StateFlow;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; - public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; - public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/Object;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; - public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/StateFlow;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; -} - diff --git a/workflow-runtime-android/build.gradle.kts b/workflow-runtime-android/build.gradle.kts deleted file mode 100644 index e254fea164..0000000000 --- a/workflow-runtime-android/build.gradle.kts +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id("com.android.library") - id("kotlin-android") - id("android-defaults") - id("android-ui-tests") - id("app.cash.burst") - id("published") -} - -android { - namespace = "com.squareup.workflow1.android" - testNamespace = "$namespace.test" -} - -dependencies { - val composeBom = platform(libs.androidx.compose.bom) - - api(project(":workflow-runtime")) - api(libs.androidx.lifecycle.viewmodel.savedstate) - - implementation(project(":workflow-core")) - - androidTestImplementation(libs.androidx.compose.ui.android) - androidTestImplementation(composeBom) - androidTestImplementation(libs.androidx.activity.ktx) - androidTestImplementation(libs.androidx.lifecycle.viewmodel.ktx) - androidTestImplementation(libs.androidx.test.core) - androidTestImplementation(libs.androidx.test.truth) - androidTestImplementation(libs.kotlin.test.core) - androidTestImplementation(libs.kotlin.test.jdk) - androidTestImplementation(libs.kotlinx.coroutines.android) - androidTestImplementation(libs.kotlinx.coroutines.core) - androidTestImplementation(libs.kotlinx.coroutines.test) - androidTestImplementation(libs.squareup.papa) -} diff --git a/workflow-runtime-android/dependencies/releaseRuntimeClasspath.txt b/workflow-runtime-android/dependencies/releaseRuntimeClasspath.txt deleted file mode 100644 index 892c42f532..0000000000 --- a/workflow-runtime-android/dependencies/releaseRuntimeClasspath.txt +++ /dev/null @@ -1,34 +0,0 @@ -androidx.annotation:annotation-jvm:1.8.1 -androidx.annotation:annotation:1.8.1 -androidx.arch.core:core-common:2.2.0 -androidx.arch.core:core-runtime:2.2.0 -androidx.collection:collection:1.0.0 -androidx.concurrent:concurrent-futures:1.1.0 -androidx.core:core-ktx:1.2.0 -androidx.core:core:1.2.0 -androidx.lifecycle:lifecycle-common-jvm:2.8.7 -androidx.lifecycle:lifecycle-common:2.8.7 -androidx.lifecycle:lifecycle-livedata-core:2.8.7 -androidx.lifecycle:lifecycle-runtime-android:2.8.7 -androidx.lifecycle:lifecycle-runtime:2.8.7 -androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 -androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 -androidx.lifecycle:lifecycle-viewmodel:2.8.7 -androidx.profileinstaller:profileinstaller:1.3.1 -androidx.savedstate:savedstate:1.2.1 -androidx.startup:startup-runtime:1.1.1 -androidx.tracing:tracing:1.0.0 -androidx.versionedparcelable:versionedparcelable:1.1.0 -com.google.guava:listenablefuture:1.0 -com.squareup.okio:okio-jvm:3.3.0 -com.squareup.okio:okio:3.3.0 -org.jetbrains.kotlin:kotlin-bom:2.1.21 -org.jetbrains.kotlin:kotlin-stdlib-common:2.1.21 -org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.21 -org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21 -org.jetbrains.kotlin:kotlin-stdlib:2.1.21 -org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0 -org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9.0 -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0 -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0 -org.jetbrains:annotations:23.0.0 diff --git a/workflow-runtime-android/gradle.properties b/workflow-runtime-android/gradle.properties deleted file mode 100644 index 5f09c5c151..0000000000 --- a/workflow-runtime-android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -POM_ARTIFACT_ID=workflow-runtime-android -POM_NAME=Workflow Runtime Android -POM_PACKAGING=aar diff --git a/workflow-runtime/README.md b/workflow-runtime/README.md index 640411767d..fb16423c54 100644 --- a/workflow-runtime/README.md +++ b/workflow-runtime/README.md @@ -5,13 +5,13 @@ This module contains the core APIs and logic for running workflows. ## Kotlin Multiplatform This module is a Kotlin Multiplatform module. The targets currently included for build and test -are `jvm`, `ios`, and `iosSimulatorSimulatorArm64`. If you are having issues with the tests, -ensure you have the correct version of XCode installed and can launch a simulator as it's specified -in the gradle build file (Currently iPhone 14). +are `jvm`, `android`, `ios`, and `iosSimulatorSimulatorArm64`. If you are having issues with the +tests, ensure you have the correct version of XCode installed and can launch a simulator as it's +specified in the gradle build file (Currently iPhone 14). You can also choose to specify your targets for build and test with the property `workflow.targets` -as either `kmp`, `jvm`, `ios`, `js`. The default is `kmp` (all the targets). Set this in your -global `~/.gradle/gradle.properties` or specify the property in your gradle command, e.g.: +as either `kmp`, `jvm`, `android`, `ios`, `js`. The default is `kmp` (all the targets). Set this in +your global `~/.gradle/gradle.properties` or specify the property in your gradle command, e.g.: ```bash ./gradlew build -Pworkflow.targets=jvm diff --git a/workflow-runtime/api/android/workflow-runtime.api b/workflow-runtime/api/android/workflow-runtime.api new file mode 100644 index 0000000000..5cccfb6dfa --- /dev/null +++ b/workflow-runtime/api/android/workflow-runtime.api @@ -0,0 +1,159 @@ +public final class com/squareup/workflow1/NoopWorkflowInterceptor : com/squareup/workflow1/WorkflowInterceptor { + public static final field INSTANCE Lcom/squareup/workflow1/NoopWorkflowInterceptor; + public fun onInitialState (Ljava/lang/Object;Lcom/squareup/workflow1/Snapshot;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public fun onPropsChanged (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public fun onRender (Ljava/lang/Object;Ljava/lang/Object;Lcom/squareup/workflow1/BaseRenderContext;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public fun onRenderAndSnapshot (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/RenderingAndSnapshot; + public fun onRuntimeUpdate (Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate;)V + public fun onSessionCancelled (Ljava/util/concurrent/CancellationException;Ljava/util/List;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public fun onSessionStarted (Lkotlinx/coroutines/CoroutineScope;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public fun onSnapshotState (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/Snapshot; + public fun onSnapshotStateWithChildren (Lkotlin/jvm/functions/Function0;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/TreeSnapshot; +} + +public final class com/squareup/workflow1/RenderWorkflowKt { + public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/StateFlow;Lcom/squareup/workflow1/TreeSnapshot;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; + public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/StateFlow;Lcom/squareup/workflow1/TreeSnapshot;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; +} + +public final class com/squareup/workflow1/RenderingAndSnapshot { + public fun (Ljava/lang/Object;Lcom/squareup/workflow1/TreeSnapshot;)V + public final fun component1 ()Ljava/lang/Object; + public final fun component2 ()Lcom/squareup/workflow1/TreeSnapshot; + public final fun getRendering ()Ljava/lang/Object; + public final fun getSnapshot ()Lcom/squareup/workflow1/TreeSnapshot; +} + +public class com/squareup/workflow1/SimpleLoggingWorkflowInterceptor : com/squareup/workflow1/WorkflowInterceptor { + public fun ()V + protected fun log (Ljava/lang/String;)V + protected fun logAfterMethod (Ljava/lang/String;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;[Lkotlin/Pair;)V + protected fun logBeforeMethod (Ljava/lang/String;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;[Lkotlin/Pair;)V + protected fun logError (Ljava/lang/String;)V + public fun onInitialState (Ljava/lang/Object;Lcom/squareup/workflow1/Snapshot;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public fun onPropsChanged (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public fun onRender (Ljava/lang/Object;Ljava/lang/Object;Lcom/squareup/workflow1/BaseRenderContext;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public fun onRenderAndSnapshot (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/RenderingAndSnapshot; + public fun onRuntimeUpdate (Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate;)V + public fun onSessionCancelled (Ljava/util/concurrent/CancellationException;Ljava/util/List;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public fun onSessionStarted (Lkotlinx/coroutines/CoroutineScope;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public fun onSnapshotState (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/Snapshot; + public fun onSnapshotStateWithChildren (Lkotlin/jvm/functions/Function0;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/TreeSnapshot; +} + +public final class com/squareup/workflow1/TreeSnapshot { + public static final field Companion Lcom/squareup/workflow1/TreeSnapshot$Companion; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public final fun toByteString ()Lokio/ByteString; + public final fun workflowSnapshotByteString ()Lokio/ByteString; +} + +public final class com/squareup/workflow1/TreeSnapshot$Companion { + public final fun forRootOnly (Lcom/squareup/workflow1/Snapshot;)Lcom/squareup/workflow1/TreeSnapshot; + public final fun parse (Lokio/ByteString;)Lcom/squareup/workflow1/TreeSnapshot; +} + +public abstract interface class com/squareup/workflow1/WorkflowInterceptor { + public abstract fun onInitialState (Ljava/lang/Object;Lcom/squareup/workflow1/Snapshot;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public abstract fun onPropsChanged (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public abstract fun onRender (Ljava/lang/Object;Ljava/lang/Object;Lcom/squareup/workflow1/BaseRenderContext;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public abstract fun onRenderAndSnapshot (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/RenderingAndSnapshot; + public abstract fun onRuntimeUpdate (Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate;)V + public abstract fun onSessionCancelled (Ljava/util/concurrent/CancellationException;Ljava/util/List;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public abstract fun onSessionStarted (Lkotlinx/coroutines/CoroutineScope;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public abstract fun onSnapshotState (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/Snapshot; + public abstract fun onSnapshotStateWithChildren (Lkotlin/jvm/functions/Function0;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/TreeSnapshot; +} + +public final class com/squareup/workflow1/WorkflowInterceptor$DefaultImpls { + public static fun onInitialState (Lcom/squareup/workflow1/WorkflowInterceptor;Ljava/lang/Object;Lcom/squareup/workflow1/Snapshot;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public static fun onPropsChanged (Lcom/squareup/workflow1/WorkflowInterceptor;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public static fun onRender (Lcom/squareup/workflow1/WorkflowInterceptor;Ljava/lang/Object;Ljava/lang/Object;Lcom/squareup/workflow1/BaseRenderContext;Lkotlin/jvm/functions/Function3;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Ljava/lang/Object; + public static fun onRenderAndSnapshot (Lcom/squareup/workflow1/WorkflowInterceptor;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/RenderingAndSnapshot; + public static fun onRuntimeUpdate (Lcom/squareup/workflow1/WorkflowInterceptor;Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate;)V + public static fun onSessionCancelled (Lcom/squareup/workflow1/WorkflowInterceptor;Ljava/util/concurrent/CancellationException;Ljava/util/List;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public static fun onSessionStarted (Lcom/squareup/workflow1/WorkflowInterceptor;Lkotlinx/coroutines/CoroutineScope;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)V + public static fun onSnapshotState (Lcom/squareup/workflow1/WorkflowInterceptor;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/Snapshot; + public static fun onSnapshotStateWithChildren (Lcom/squareup/workflow1/WorkflowInterceptor;Lkotlin/jvm/functions/Function0;Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Lcom/squareup/workflow1/TreeSnapshot; +} + +public abstract interface class com/squareup/workflow1/WorkflowInterceptor$RenderContextInterceptor { + public abstract fun onActionSent (Lcom/squareup/workflow1/WorkflowAction;Lkotlin/jvm/functions/Function1;)V + public abstract fun onRemember (Ljava/lang/String;Lkotlin/reflect/KType;[Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function4;)Ljava/lang/Object; + public abstract fun onRenderChild (Lcom/squareup/workflow1/Workflow;Ljava/lang/Object;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;)Ljava/lang/Object; + public abstract fun onRunningSideEffect (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V +} + +public final class com/squareup/workflow1/WorkflowInterceptor$RenderContextInterceptor$DefaultImpls { + public static fun onActionSent (Lcom/squareup/workflow1/WorkflowInterceptor$RenderContextInterceptor;Lcom/squareup/workflow1/WorkflowAction;Lkotlin/jvm/functions/Function1;)V + public static fun onRemember (Lcom/squareup/workflow1/WorkflowInterceptor$RenderContextInterceptor;Ljava/lang/String;Lkotlin/reflect/KType;[Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function4;)Ljava/lang/Object; + public static fun onRenderChild (Lcom/squareup/workflow1/WorkflowInterceptor$RenderContextInterceptor;Lcom/squareup/workflow1/Workflow;Ljava/lang/Object;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;)Ljava/lang/Object; + public static fun onRunningSideEffect (Lcom/squareup/workflow1/WorkflowInterceptor$RenderContextInterceptor;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V +} + +public final class com/squareup/workflow1/WorkflowInterceptor$RenderPassSkipped : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { + public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RenderPassSkipped; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class com/squareup/workflow1/WorkflowInterceptor$RenderingConflated : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { + public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RenderingConflated; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class com/squareup/workflow1/WorkflowInterceptor$RenderingProduced : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { + public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RenderingProduced; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final class com/squareup/workflow1/WorkflowInterceptor$RuntimeSettled : com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { + public static final field INSTANCE Lcom/squareup/workflow1/WorkflowInterceptor$RuntimeSettled; + public fun equals (Ljava/lang/Object;)Z + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public abstract interface class com/squareup/workflow1/WorkflowInterceptor$RuntimeUpdate { +} + +public abstract interface class com/squareup/workflow1/WorkflowInterceptor$WorkflowSession { + public abstract fun getIdentifier ()Lcom/squareup/workflow1/WorkflowIdentifier; + public abstract fun getParent ()Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession; + public abstract fun getRenderKey ()Ljava/lang/String; + public abstract fun getRuntimeConfig ()Ljava/util/Set; + public abstract fun getRuntimeContext ()Lkotlin/coroutines/CoroutineContext; + public abstract fun getSessionId ()J + public abstract fun getWorkflowTracer ()Lcom/squareup/workflow1/WorkflowTracer; + public abstract fun isRootWorkflow ()Z +} + +public final class com/squareup/workflow1/WorkflowInterceptor$WorkflowSession$DefaultImpls { + public static fun isRootWorkflow (Lcom/squareup/workflow1/WorkflowInterceptor$WorkflowSession;)Z +} + +public final class com/squareup/workflow1/android/AndroidRenderWorkflowKt { + public static final fun removeWorkflowState (Landroidx/lifecycle/SavedStateHandle;)V + public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; + public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/Object;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; + public static final fun renderWorkflowIn (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/StateFlow;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/StateFlow; + public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; + public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/Object;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; + public static synthetic fun renderWorkflowIn$default (Lcom/squareup/workflow1/Workflow;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/StateFlow;Landroidx/lifecycle/SavedStateHandle;Ljava/util/List;Ljava/util/Set;Lcom/squareup/workflow1/WorkflowTracer;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow; +} + +public final class com/squareup/workflow1/internal/ThrowablesKt { + public static final fun requireNotNullWithKey (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object; + public static synthetic fun requireNotNullWithKey$default (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Ljava/lang/Object; +} + +public final class com/squareup/workflow1/internal/Throwables_androidKt { + public static final fun withKey (Ljava/lang/Throwable;Ljava/lang/Object;)Ljava/lang/Throwable; +} + diff --git a/workflow-runtime/api/workflow-runtime.api b/workflow-runtime/api/jvm/workflow-runtime.api similarity index 100% rename from workflow-runtime/api/workflow-runtime.api rename to workflow-runtime/api/jvm/workflow-runtime.api diff --git a/workflow-runtime/build.gradle.kts b/workflow-runtime/build.gradle.kts index f9140c464b..7c0f9e1849 100644 --- a/workflow-runtime/build.gradle.kts +++ b/workflow-runtime/build.gradle.kts @@ -1,13 +1,21 @@ +import com.android.build.api.dsl.androidLibrary import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64 -import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi plugins { + // This is the new/future plugin for Android in KMP. com.android.library is going away. + // See https://developer.android.com/kotlin/multiplatform/plugin + id("com.android.kotlin.multiplatform.library") + // This is our own convention plugin, not the standard one. id("kotlin-multiplatform") id("published") id("app.cash.burst") } kotlin { + // Needed for expect class Lock, which is not public API, so this doesn't add any binary compat + // risk. + compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes") + val targets = project.findProperty("workflow.targets") ?: "kmp" if (targets == "kmp" || targets == "ios") { iosWithSimulatorArm64() @@ -15,20 +23,75 @@ kotlin { if (targets == "kmp" || targets == "jvm") { jvm {} } + if (targets == "kmp" || targets == "android") { + @Suppress("UnstableApiUsage") + androidLibrary { + namespace = "com.squareup.workflow1.android" + testNamespace = "$namespace.test" + + compileSdk = libs.versions.compileSdk.get().toInt() + minSdk = libs.versions.minSdk.get().toInt() + + withDeviceTest { + instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + + // Disable transition and rotation animations. + animationsDisabled = true + } + } + } if (targets == "kmp" || targets == "js") { js(IR) { browser() } } - // Needed for expect class Lock, which is not public API, so this doesn't add any binary compat - // risk. - @OptIn(ExperimentalKotlinGradlePluginApi::class) - compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes") -} + sourceSets { + commonMain { + dependencies { + api(project(":workflow-core")) + api(libs.kotlinx.coroutines.core) + } + } + + commonTest { + dependencies { + implementation(libs.kotlinx.coroutines.test.common) + implementation(libs.kotlin.test.core) + } + } + + androidMain { + dependencies { + // Add Android-specific dependencies here. Note that this source set depends on + // commonMain by default and will correctly pull the Android artifacts of any KMP + // dependencies declared in commonMain. + val composeBom = project.dependencies.platform(libs.androidx.compose.bom) -dependencies { - commonMainApi(project(":workflow-core")) - commonMainApi(libs.kotlinx.coroutines.core) + api(libs.androidx.compose.ui.android) + api(libs.androidx.lifecycle.viewmodel.savedstate) - commonTestImplementation(libs.kotlinx.coroutines.test.common) - commonTestImplementation(libs.kotlin.test.core) + implementation(composeBom) + } + } + + getByName("androidDeviceTest") { + dependencies { + implementation(project(":workflow-ui:internal-testing-android")) + + implementation(libs.androidx.test.espresso.core) + implementation(libs.androidx.test.junit) + implementation(libs.squareup.leakcanary.instrumentation) + + implementation(libs.androidx.activity.ktx) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + implementation(libs.androidx.test.core) + implementation(libs.androidx.test.truth) + implementation(libs.kotlin.test.core) + implementation(libs.kotlin.test.jdk) + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.coroutines.test) + implementation(libs.squareup.papa) + implementation(libs.burst) + } + } + } } diff --git a/workflow-runtime/dependencies/androidRuntimeClasspath.txt b/workflow-runtime/dependencies/androidRuntimeClasspath.txt new file mode 100644 index 0000000000..4461d2b976 --- /dev/null +++ b/workflow-runtime/dependencies/androidRuntimeClasspath.txt @@ -0,0 +1,67 @@ +androidx.activity:activity-ktx:1.7.0 +androidx.activity:activity:1.7.0 +androidx.annotation:annotation-experimental:1.4.1 +androidx.annotation:annotation-jvm:1.8.1 +androidx.annotation:annotation:1.8.1 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.autofill:autofill:1.0.0 +androidx.collection:collection-jvm:1.4.4 +androidx.collection:collection-ktx:1.4.4 +androidx.collection:collection:1.4.4 +androidx.compose.runtime:runtime-android:1.7.8 +androidx.compose.runtime:runtime-saveable-android:1.7.8 +androidx.compose.runtime:runtime-saveable:1.7.8 +androidx.compose.runtime:runtime:1.7.8 +androidx.compose.ui:ui-android:1.7.8 +androidx.compose.ui:ui-geometry-android:1.7.8 +androidx.compose.ui:ui-geometry:1.7.8 +androidx.compose.ui:ui-graphics-android:1.7.8 +androidx.compose.ui:ui-graphics:1.7.8 +androidx.compose.ui:ui-text-android:1.7.8 +androidx.compose.ui:ui-text:1.7.8 +androidx.compose.ui:ui-unit-android:1.7.8 +androidx.compose.ui:ui-unit:1.7.8 +androidx.compose.ui:ui-util-android:1.7.8 +androidx.compose.ui:ui-util:1.7.8 +androidx.compose:compose-bom:2025.03.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.core:core-ktx:1.12.0 +androidx.core:core:1.12.0 +androidx.customview:customview-poolingcontainer:1.0.0 +androidx.emoji2:emoji2:1.2.0 +androidx.graphics:graphics-path:1.0.1 +androidx.interpolator:interpolator:1.0.0 +androidx.lifecycle:lifecycle-common-jvm:2.8.7 +androidx.lifecycle:lifecycle-common:2.8.7 +androidx.lifecycle:lifecycle-livedata-core:2.8.7 +androidx.lifecycle:lifecycle-process:2.8.7 +androidx.lifecycle:lifecycle-runtime-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx:2.8.7 +androidx.lifecycle:lifecycle-runtime:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 +androidx.lifecycle:lifecycle-viewmodel:2.8.7 +androidx.profileinstaller:profileinstaller:1.3.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.startup:startup-runtime:1.1.1 +androidx.tracing:tracing:1.0.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +com.google.guava:listenablefuture:1.0 +com.squareup.okio:okio-jvm:3.3.0 +com.squareup.okio:okio:3.3.0 +org.jetbrains.kotlin:kotlin-bom:2.1.21 +org.jetbrains.kotlin:kotlin-stdlib-common:2.1.21 +org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.21 +org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21 +org.jetbrains.kotlin:kotlin-stdlib:2.1.21 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0 +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0 +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0 +org.jetbrains:annotations:23.0.0 diff --git a/workflow-runtime-android/src/androidTest/AndroidManifest.xml b/workflow-runtime/src/androidDeviceTest/AndroidManifest.xml similarity index 100% rename from workflow-runtime-android/src/androidTest/AndroidManifest.xml rename to workflow-runtime/src/androidDeviceTest/AndroidManifest.xml diff --git a/workflow-runtime-android/src/androidTest/java/com/squareup/workflow1/android/AndroidDispatchersRenderWorkflowInTest.kt b/workflow-runtime/src/androidDeviceTest/kotlin/com/squareup/workflow1/android/AndroidDispatchersRenderWorkflowInTest.kt similarity index 100% rename from workflow-runtime-android/src/androidTest/java/com/squareup/workflow1/android/AndroidDispatchersRenderWorkflowInTest.kt rename to workflow-runtime/src/androidDeviceTest/kotlin/com/squareup/workflow1/android/AndroidDispatchersRenderWorkflowInTest.kt diff --git a/workflow-runtime-android/src/androidTest/java/com/squareup/workflow1/android/AndroidRenderWorkflowInTest.kt b/workflow-runtime/src/androidDeviceTest/kotlin/com/squareup/workflow1/android/AndroidRenderWorkflowInTest.kt similarity index 100% rename from workflow-runtime-android/src/androidTest/java/com/squareup/workflow1/android/AndroidRenderWorkflowInTest.kt rename to workflow-runtime/src/androidDeviceTest/kotlin/com/squareup/workflow1/android/AndroidRenderWorkflowInTest.kt diff --git a/workflow-runtime/src/androidMain/README.md b/workflow-runtime/src/androidMain/README.md new file mode 100644 index 0000000000..af4bc6316b --- /dev/null +++ b/workflow-runtime/src/androidMain/README.md @@ -0,0 +1,10 @@ +# Android vs JVM targets + +The default KMP +["hierarchy template"](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-hierarchy.html#see-the-full-hierarchy-template) +configures `androidMain` and `jvmMain` to be entirely separate targets, even though Android *can* +be made to be a child of JVM. Changing this requires completely wiring up all targets ourselves +though, so for now we've left them separate to simplify gradle config. If there ends up being too +much code duplication, we can either make `androidMain` a child of `jvmMain`, or introduce a new +shared target that includes both of them. Compose, for example, uses a structure where `jvm` is the +shared parent of both `android` and `desktop`. diff --git a/workflow-runtime-android/src/main/java/com/squareup/workflow1/android/AndroidRenderWorkflow.kt b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/android/AndroidRenderWorkflow.kt similarity index 100% rename from workflow-runtime-android/src/main/java/com/squareup/workflow1/android/AndroidRenderWorkflow.kt rename to workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/android/AndroidRenderWorkflow.kt diff --git a/workflow-runtime-android/src/main/java/com/squareup/workflow1/android/PickledTreesnapshot.kt b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/android/PickledTreesnapshot.kt similarity index 100% rename from workflow-runtime-android/src/main/java/com/squareup/workflow1/android/PickledTreesnapshot.kt rename to workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/android/PickledTreesnapshot.kt diff --git a/workflow-runtime-android/src/main/java/com/squareup/workflow1/android/TreeSnapshotSaver.kt b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/android/TreeSnapshotSaver.kt similarity index 100% rename from workflow-runtime-android/src/main/java/com/squareup/workflow1/android/TreeSnapshotSaver.kt rename to workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/android/TreeSnapshotSaver.kt diff --git a/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/Synchronization.android.kt b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/Synchronization.android.kt new file mode 100644 index 0000000000..6bfa2fa2cf --- /dev/null +++ b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/Synchronization.android.kt @@ -0,0 +1,10 @@ +package com.squareup.workflow1.internal + +internal actual typealias Lock = Any + +internal actual inline fun Lock.withLock(block: () -> R): R = synchronized(this, block) + +internal actual typealias ThreadLocal = java.lang.ThreadLocal + +internal actual fun threadLocalOf(initialValue: () -> T): ThreadLocal = + ThreadLocal.withInitial(initialValue) diff --git a/workflow-runtime/src/jvmMain/kotlin/com/squareup/workflow1/internal/SystemUtils.kt b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/SystemUtils.android.kt similarity index 100% rename from workflow-runtime/src/jvmMain/kotlin/com/squareup/workflow1/internal/SystemUtils.kt rename to workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/SystemUtils.android.kt diff --git a/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/Throwables.android.kt b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/Throwables.android.kt new file mode 100644 index 0000000000..2f5013e809 --- /dev/null +++ b/workflow-runtime/src/androidMain/kotlin/com/squareup/workflow1/internal/Throwables.android.kt @@ -0,0 +1,15 @@ +package com.squareup.workflow1.internal + +public actual fun T.withKey(stackTraceKey: Any): T = apply { + val realTop = stackTrace[0] + val fakeTop = StackTraceElement( + // Real class name to ensure that we are still "in project". + realTop.className, + "fakeMethodForCrashGrouping", + /* fileName = */ + stackTraceKey.toString(), + /* lineNumber = */ + stackTraceKey.hashCode() + ) + stackTrace = stackTrace.toMutableList().apply { add(0, fakeTop) }.toTypedArray() +} diff --git a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/TreeSnapshot.kt b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/TreeSnapshot.kt index e4c99bc400..8f69321fba 100644 --- a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/TreeSnapshot.kt +++ b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/TreeSnapshot.kt @@ -63,7 +63,7 @@ public class TreeSnapshot internal constructor( sink.readByteString() } - fun workflowSnapshotByteString(): ByteString? { + public fun workflowSnapshotByteString(): ByteString? { return workflowSnapshot?.bytes } diff --git a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/Throwables.kt b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/Throwables.kt index 47bdfac41a..77b3fee747 100644 --- a/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/Throwables.kt +++ b/workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/Throwables.kt @@ -13,7 +13,7 @@ import kotlin.contracts.contract * @throws IllegalArgumentException if the [value] is false. */ @OptIn(ExperimentalContracts::class) -inline fun requireNotNullWithKey( +public inline fun requireNotNullWithKey( value: T?, stackTraceKey: Any, lazyMessage: () -> Any = { "Required value was null." } @@ -102,4 +102,4 @@ internal inline fun checkWithKey( * for crash reporters. It is important that keys are stable across processes, * avoid system hashes. */ -expect fun T.withKey(stackTraceKey: Any): T +public expect fun T.withKey(stackTraceKey: Any): T diff --git a/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/ReflectionNames.kt b/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/ReflectionNames.kt deleted file mode 100644 index 7761301410..0000000000 --- a/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/ReflectionNames.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.squareup.workflow1 - -expect val ILLEGAL_ARGUMENT_EXCEPTION_NAME: String diff --git a/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt b/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt index b3455cbf3b..0889fab6b3 100644 --- a/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt +++ b/workflow-runtime/src/commonTest/kotlin/com/squareup/workflow1/SimpleLoggingWorkflowInterceptorTest.kt @@ -9,6 +9,7 @@ import kotlin.reflect.KType import kotlin.reflect.typeOf import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue import kotlin.test.fail internal class SimpleLoggingWorkflowInterceptorTest { @@ -21,7 +22,7 @@ internal class SimpleLoggingWorkflowInterceptorTest { // Only the first, since we don't get cancellation directly from the scope cancellation. // For that we use onSessionCancelled() - assertEquals(listOf(ErrorLoggingInterceptor.EXPECTED_ERRORS.first()), interceptor.errors) + assertAllMatch(listOf(ErrorLoggingInterceptor.EXPECTED_ERRORS.first()), interceptor.errors) } @Test fun onSessionCancelled_handles_logging_exceptions() { @@ -33,7 +34,7 @@ internal class SimpleLoggingWorkflowInterceptorTest { ) // Only the second error, since onSessionCancelled only calls logAfterMethod - assertEquals(listOf(ErrorLoggingInterceptor.EXPECTED_ERRORS.last()), interceptor.errors) + assertAllMatch(listOf(ErrorLoggingInterceptor.EXPECTED_ERRORS.last()), interceptor.errors) } @Test fun onInitialState_handles_logging_exceptions() { @@ -46,14 +47,14 @@ internal class SimpleLoggingWorkflowInterceptorTest { TestWorkflowSession ) - assertEquals(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) + assertAllMatch(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) } @Test fun onPropsChanged_handles_logging_exceptions() { val interceptor = ErrorLoggingInterceptor() interceptor.onPropsChanged(Unit, Unit, Unit, { _, _, _ -> }, TestWorkflowSession) - assertEquals(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) + assertAllMatch(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) } @Test fun onRender_handles_logging_exceptions() { @@ -67,14 +68,14 @@ internal class SimpleLoggingWorkflowInterceptorTest { TestWorkflowSession, ) - assertEquals(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) + assertAllMatch(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) } @Test fun onSnapshotState_handles_logging_exceptions() { val interceptor = ErrorLoggingInterceptor() interceptor.onSnapshotState(Unit, { null }, TestWorkflowSession) - assertEquals(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) + assertAllMatch(ErrorLoggingInterceptor.EXPECTED_ERRORS, interceptor.errors) } private open class ErrorLoggingInterceptor : SimpleLoggingWorkflowInterceptor() { @@ -90,10 +91,27 @@ internal class SimpleLoggingWorkflowInterceptorTest { companion object { val EXPECTED_ERRORS = listOf( - "ErrorLoggingInterceptor.logBeforeMethod threw exception:\n" + - ILLEGAL_ARGUMENT_EXCEPTION_NAME, - "ErrorLoggingInterceptor.logAfterMethod threw exception:\n" + - ILLEGAL_ARGUMENT_EXCEPTION_NAME + ( + "ErrorLoggingInterceptor\\.logBeforeMethod threw exception:\n" + + ".+IllegalArgumentException.*" + ).toRegex(), + ( + "ErrorLoggingInterceptor\\.logAfterMethod threw exception:\n" + + ".+IllegalArgumentException.*" + ).toRegex() + ) + } + } + + private fun assertAllMatch( + expected: List, + actual: List + ) { + assertEquals(expected.size, actual.size) + expected.zip(actual).forEachIndexed { index, (expectedPattern, actualString) -> + assertTrue( + expectedPattern.matches(actualString), + "Expected string at index $index to match pattern /$expectedPattern/: \"$actualString\"" ) } } diff --git a/workflow-runtime/src/iosTest/kotlin/com/squareup/workflow1/ReflectionNames.kt b/workflow-runtime/src/iosTest/kotlin/com/squareup/workflow1/ReflectionNames.kt deleted file mode 100644 index 29388c00c1..0000000000 --- a/workflow-runtime/src/iosTest/kotlin/com/squareup/workflow1/ReflectionNames.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.squareup.workflow1 - -actual val ILLEGAL_ARGUMENT_EXCEPTION_NAME = - IllegalArgumentException::class.qualifiedName.toString() diff --git a/workflow-runtime/src/jsTest/kotlin/com/squareup/workflow1/ReflectionNames.kt b/workflow-runtime/src/jsTest/kotlin/com/squareup/workflow1/ReflectionNames.kt deleted file mode 100644 index 405787e502..0000000000 --- a/workflow-runtime/src/jsTest/kotlin/com/squareup/workflow1/ReflectionNames.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.squareup.workflow1 - -actual val ILLEGAL_ARGUMENT_EXCEPTION_NAME = IllegalArgumentException::class.simpleName.toString() diff --git a/workflow-runtime/src/jvmMain/kotlin/com/squareup/workflow1/internal/SystemUtils.jvm.kt b/workflow-runtime/src/jvmMain/kotlin/com/squareup/workflow1/internal/SystemUtils.jvm.kt new file mode 100644 index 0000000000..354e7ef9ca --- /dev/null +++ b/workflow-runtime/src/jvmMain/kotlin/com/squareup/workflow1/internal/SystemUtils.jvm.kt @@ -0,0 +1,3 @@ +package com.squareup.workflow1.internal + +internal actual fun currentTimeMillis(): Long = System.currentTimeMillis() diff --git a/workflow-runtime/src/jvmTest/kotlin/com/squareup/workflow1/ReflectionNames.kt b/workflow-runtime/src/jvmTest/kotlin/com/squareup/workflow1/ReflectionNames.kt deleted file mode 100644 index 29388c00c1..0000000000 --- a/workflow-runtime/src/jvmTest/kotlin/com/squareup/workflow1/ReflectionNames.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.squareup.workflow1 - -actual val ILLEGAL_ARGUMENT_EXCEPTION_NAME = - IllegalArgumentException::class.qualifiedName.toString() diff --git a/workflow-tracing-papa/dependencies/releaseRuntimeClasspath.txt b/workflow-tracing-papa/dependencies/releaseRuntimeClasspath.txt index a9e00dcbac..f88b715770 100644 --- a/workflow-tracing-papa/dependencies/releaseRuntimeClasspath.txt +++ b/workflow-tracing-papa/dependencies/releaseRuntimeClasspath.txt @@ -1,9 +1,59 @@ +androidx.activity:activity-ktx:1.7.0 +androidx.activity:activity:1.7.0 +androidx.annotation:annotation-experimental:1.4.1 androidx.annotation:annotation-jvm:1.9.1 androidx.annotation:annotation:1.9.1 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.autofill:autofill:1.0.0 androidx.collection:collection-jvm:1.5.0 +androidx.collection:collection-ktx:1.5.0 androidx.collection:collection:1.5.0 +androidx.compose.runtime:runtime-android:1.7.8 +androidx.compose.runtime:runtime-saveable-android:1.7.8 +androidx.compose.runtime:runtime-saveable:1.7.8 +androidx.compose.runtime:runtime:1.7.8 +androidx.compose.ui:ui-android:1.7.8 +androidx.compose.ui:ui-geometry-android:1.7.8 +androidx.compose.ui:ui-geometry:1.7.8 +androidx.compose.ui:ui-graphics-android:1.7.8 +androidx.compose.ui:ui-graphics:1.7.8 +androidx.compose.ui:ui-text-android:1.7.8 +androidx.compose.ui:ui-text:1.7.8 +androidx.compose.ui:ui-unit-android:1.7.8 +androidx.compose.ui:ui-unit:1.7.8 +androidx.compose.ui:ui-util-android:1.7.8 +androidx.compose.ui:ui-util:1.7.8 +androidx.compose:compose-bom:2025.03.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.core:core-ktx:1.12.0 +androidx.core:core:1.12.0 +androidx.customview:customview-poolingcontainer:1.0.0 +androidx.emoji2:emoji2:1.2.0 +androidx.graphics:graphics-path:1.0.1 +androidx.interpolator:interpolator:1.0.0 +androidx.lifecycle:lifecycle-common-jvm:2.8.7 +androidx.lifecycle:lifecycle-common:2.8.7 +androidx.lifecycle:lifecycle-livedata-core:2.8.7 +androidx.lifecycle:lifecycle-process:2.8.7 +androidx.lifecycle:lifecycle-runtime-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx:2.8.7 +androidx.lifecycle:lifecycle-runtime:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 +androidx.lifecycle:lifecycle-viewmodel:2.8.7 +androidx.profileinstaller:profileinstaller:1.3.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.startup:startup-runtime:1.1.1 androidx.tracing:tracing-ktx:1.2.0 androidx.tracing:tracing:1.2.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +com.google.guava:listenablefuture:1.0 com.squareup.okio:okio-jvm:3.3.0 com.squareup.okio:okio:3.3.0 org.jetbrains.kotlin:kotlin-bom:2.1.21 @@ -11,6 +61,7 @@ org.jetbrains.kotlin:kotlin-stdlib-common:2.1.21 org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.21 org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21 org.jetbrains.kotlin:kotlin-stdlib:2.1.21 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0 diff --git a/workflow-tracing/dependencies/releaseRuntimeClasspath.txt b/workflow-tracing/dependencies/releaseRuntimeClasspath.txt index 1c00b07c03..0a98c61734 100644 --- a/workflow-tracing/dependencies/releaseRuntimeClasspath.txt +++ b/workflow-tracing/dependencies/releaseRuntimeClasspath.txt @@ -1,7 +1,58 @@ +androidx.activity:activity-ktx:1.7.0 +androidx.activity:activity:1.7.0 +androidx.annotation:annotation-experimental:1.4.1 androidx.annotation:annotation-jvm:1.9.1 androidx.annotation:annotation:1.9.1 +androidx.arch.core:core-common:2.2.0 +androidx.arch.core:core-runtime:2.2.0 +androidx.autofill:autofill:1.0.0 androidx.collection:collection-jvm:1.5.0 +androidx.collection:collection-ktx:1.5.0 androidx.collection:collection:1.5.0 +androidx.compose.runtime:runtime-android:1.7.8 +androidx.compose.runtime:runtime-saveable-android:1.7.8 +androidx.compose.runtime:runtime-saveable:1.7.8 +androidx.compose.runtime:runtime:1.7.8 +androidx.compose.ui:ui-android:1.7.8 +androidx.compose.ui:ui-geometry-android:1.7.8 +androidx.compose.ui:ui-geometry:1.7.8 +androidx.compose.ui:ui-graphics-android:1.7.8 +androidx.compose.ui:ui-graphics:1.7.8 +androidx.compose.ui:ui-text-android:1.7.8 +androidx.compose.ui:ui-text:1.7.8 +androidx.compose.ui:ui-unit-android:1.7.8 +androidx.compose.ui:ui-unit:1.7.8 +androidx.compose.ui:ui-util-android:1.7.8 +androidx.compose.ui:ui-util:1.7.8 +androidx.compose:compose-bom:2025.03.01 +androidx.concurrent:concurrent-futures:1.1.0 +androidx.core:core-ktx:1.12.0 +androidx.core:core:1.12.0 +androidx.customview:customview-poolingcontainer:1.0.0 +androidx.emoji2:emoji2:1.2.0 +androidx.graphics:graphics-path:1.0.1 +androidx.interpolator:interpolator:1.0.0 +androidx.lifecycle:lifecycle-common-jvm:2.8.7 +androidx.lifecycle:lifecycle-common:2.8.7 +androidx.lifecycle:lifecycle-livedata-core:2.8.7 +androidx.lifecycle:lifecycle-process:2.8.7 +androidx.lifecycle:lifecycle-runtime-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-ktx:2.8.7 +androidx.lifecycle:lifecycle-runtime:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 +androidx.lifecycle:lifecycle-viewmodel:2.8.7 +androidx.profileinstaller:profileinstaller:1.3.1 +androidx.savedstate:savedstate-ktx:1.2.1 +androidx.savedstate:savedstate:1.2.1 +androidx.startup:startup-runtime:1.1.1 +androidx.tracing:tracing:1.0.0 +androidx.versionedparcelable:versionedparcelable:1.1.1 +com.google.guava:listenablefuture:1.0 com.squareup.okio:okio-jvm:3.3.0 com.squareup.okio:okio:3.3.0 org.jetbrains.kotlin:kotlin-bom:2.1.21 @@ -9,6 +60,7 @@ org.jetbrains.kotlin:kotlin-stdlib-common:2.1.21 org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.21 org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21 org.jetbrains.kotlin:kotlin-stdlib:2.1.21 +org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0 org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0 diff --git a/workflow-ui/core-android/build.gradle.kts b/workflow-ui/core-android/build.gradle.kts index 7d15369a63..5ff9210aa6 100644 --- a/workflow-ui/core-android/build.gradle.kts +++ b/workflow-ui/core-android/build.gradle.kts @@ -23,7 +23,6 @@ dependencies { // Needs to be API for the WorkflowInterceptor argument to WorkflowRunner.Config. api(project(":workflow-runtime")) - api(project(":workflow-runtime-android")) api(project(":workflow-ui:core-common")) compileOnly(libs.androidx.viewbinding) diff --git a/workflow-ui/core-android/dependencies/releaseRuntimeClasspath.txt b/workflow-ui/core-android/dependencies/releaseRuntimeClasspath.txt index 39231afcbb..774b0387af 100644 --- a/workflow-ui/core-android/dependencies/releaseRuntimeClasspath.txt +++ b/workflow-ui/core-android/dependencies/releaseRuntimeClasspath.txt @@ -1,15 +1,38 @@ +androidx.activity:activity-ktx:1.8.2 androidx.activity:activity:1.8.2 -androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-experimental:1.4.1 androidx.annotation:annotation-jvm:1.8.1 androidx.annotation:annotation:1.8.1 androidx.arch.core:core-common:2.2.0 androidx.arch.core:core-runtime:2.2.0 -androidx.collection:collection:1.1.0 +androidx.autofill:autofill:1.0.0 +androidx.collection:collection-jvm:1.4.4 +androidx.collection:collection-ktx:1.4.4 +androidx.collection:collection:1.4.4 +androidx.compose.runtime:runtime-android:1.7.8 +androidx.compose.runtime:runtime-saveable-android:1.7.8 +androidx.compose.runtime:runtime-saveable:1.7.8 +androidx.compose.runtime:runtime:1.7.8 +androidx.compose.ui:ui-android:1.7.8 +androidx.compose.ui:ui-geometry-android:1.7.8 +androidx.compose.ui:ui-geometry:1.7.8 +androidx.compose.ui:ui-graphics-android:1.7.8 +androidx.compose.ui:ui-graphics:1.7.8 +androidx.compose.ui:ui-text-android:1.7.8 +androidx.compose.ui:ui-text:1.7.8 +androidx.compose.ui:ui-unit-android:1.7.8 +androidx.compose.ui:ui-unit:1.7.8 +androidx.compose.ui:ui-util-android:1.7.8 +androidx.compose.ui:ui-util:1.7.8 +androidx.compose:compose-bom:2025.03.01 androidx.concurrent:concurrent-futures:1.1.0 androidx.core:core-ktx:1.13.1 androidx.core:core:1.13.1 +androidx.customview:customview-poolingcontainer:1.0.0 androidx.documentfile:documentfile:1.0.0 androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.emoji2:emoji2:1.2.0 +androidx.graphics:graphics-path:1.0.1 androidx.interpolator:interpolator:1.0.0 androidx.legacy:legacy-support-core-utils:1.0.0 androidx.lifecycle:lifecycle-common-jvm:2.8.7 @@ -17,17 +40,22 @@ androidx.lifecycle:lifecycle-common:2.8.7 androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.7 androidx.lifecycle:lifecycle-livedata-core:2.8.7 androidx.lifecycle:lifecycle-livedata:2.8.7 +androidx.lifecycle:lifecycle-process:2.8.7 androidx.lifecycle:lifecycle-runtime-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose:2.8.7 androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7 androidx.lifecycle:lifecycle-runtime-ktx:2.8.7 androidx.lifecycle:lifecycle-runtime:2.8.7 androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7 androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 androidx.lifecycle:lifecycle-viewmodel:2.8.7 androidx.loader:loader:1.0.0 androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 androidx.print:print:1.0.0 androidx.profileinstaller:profileinstaller:1.3.1 +androidx.savedstate:savedstate-ktx:1.2.1 androidx.savedstate:savedstate:1.2.1 androidx.startup:startup-runtime:1.1.1 androidx.tracing:tracing:1.0.0 diff --git a/workflow-ui/radiography/dependencies/releaseRuntimeClasspath.txt b/workflow-ui/radiography/dependencies/releaseRuntimeClasspath.txt index 6398791ecb..ab279c9a41 100644 --- a/workflow-ui/radiography/dependencies/releaseRuntimeClasspath.txt +++ b/workflow-ui/radiography/dependencies/releaseRuntimeClasspath.txt @@ -1,15 +1,38 @@ +androidx.activity:activity-ktx:1.8.2 androidx.activity:activity:1.8.2 -androidx.annotation:annotation-experimental:1.4.0 +androidx.annotation:annotation-experimental:1.4.1 androidx.annotation:annotation-jvm:1.8.1 androidx.annotation:annotation:1.8.1 androidx.arch.core:core-common:2.2.0 androidx.arch.core:core-runtime:2.2.0 -androidx.collection:collection:1.1.0 +androidx.autofill:autofill:1.0.0 +androidx.collection:collection-jvm:1.4.4 +androidx.collection:collection-ktx:1.4.4 +androidx.collection:collection:1.4.4 +androidx.compose.runtime:runtime-android:1.7.8 +androidx.compose.runtime:runtime-saveable-android:1.7.8 +androidx.compose.runtime:runtime-saveable:1.7.8 +androidx.compose.runtime:runtime:1.7.8 +androidx.compose.ui:ui-android:1.7.8 +androidx.compose.ui:ui-geometry-android:1.7.8 +androidx.compose.ui:ui-geometry:1.7.8 +androidx.compose.ui:ui-graphics-android:1.7.8 +androidx.compose.ui:ui-graphics:1.7.8 +androidx.compose.ui:ui-text-android:1.7.8 +androidx.compose.ui:ui-text:1.7.8 +androidx.compose.ui:ui-unit-android:1.7.8 +androidx.compose.ui:ui-unit:1.7.8 +androidx.compose.ui:ui-util-android:1.7.8 +androidx.compose.ui:ui-util:1.7.8 +androidx.compose:compose-bom:2025.03.01 androidx.concurrent:concurrent-futures:1.1.0 androidx.core:core-ktx:1.13.1 androidx.core:core:1.13.1 +androidx.customview:customview-poolingcontainer:1.0.0 androidx.documentfile:documentfile:1.0.0 androidx.dynamicanimation:dynamicanimation:1.0.0 +androidx.emoji2:emoji2:1.2.0 +androidx.graphics:graphics-path:1.0.1 androidx.interpolator:interpolator:1.0.0 androidx.legacy:legacy-support-core-utils:1.0.0 androidx.lifecycle:lifecycle-common-jvm:2.8.7 @@ -17,17 +40,22 @@ androidx.lifecycle:lifecycle-common:2.8.7 androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.7 androidx.lifecycle:lifecycle-livedata-core:2.8.7 androidx.lifecycle:lifecycle-livedata:2.8.7 +androidx.lifecycle:lifecycle-process:2.8.7 androidx.lifecycle:lifecycle-runtime-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7 +androidx.lifecycle:lifecycle-runtime-compose:2.8.7 androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7 androidx.lifecycle:lifecycle-runtime-ktx:2.8.7 androidx.lifecycle:lifecycle-runtime:2.8.7 androidx.lifecycle:lifecycle-viewmodel-android:2.8.7 +androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7 androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7 androidx.lifecycle:lifecycle-viewmodel:2.8.7 androidx.loader:loader:1.0.0 androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 androidx.print:print:1.0.0 androidx.profileinstaller:profileinstaller:1.3.1 +androidx.savedstate:savedstate-ktx:1.2.1 androidx.savedstate:savedstate:1.2.1 androidx.startup:startup-runtime:1.1.1 androidx.tracing:tracing:1.0.0