Skip to content

Commit 7deeba3

Browse files
Merge pull request #1378 from square/zachklipp/revert-kmpization
Revert two recent PRs that add KMP android source sets
2 parents 6c484f6 + 58c1d40 commit 7deeba3

File tree

41 files changed

+151
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+151
-398
lines changed

artifacts.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
"javaVersion": 8,
1818
"publicationName": "maven"
1919
},
20-
{
21-
"gradlePath": ":workflow-core",
22-
"group": "com.squareup.workflow1",
23-
"artifactId": "workflow-core-android",
24-
"description": "Workflow Core",
25-
"packaging": "aar",
26-
"javaVersion": 8,
27-
"publicationName": "android"
28-
},
2920
{
3021
"gradlePath": ":workflow-core",
3122
"group": "com.squareup.workflow1",
@@ -80,15 +71,6 @@
8071
"javaVersion": 8,
8172
"publicationName": "kotlinMultiplatform"
8273
},
83-
{
84-
"gradlePath": ":workflow-runtime",
85-
"group": "com.squareup.workflow1",
86-
"artifactId": "workflow-runtime-android",
87-
"description": "Workflow Runtime",
88-
"packaging": "aar",
89-
"javaVersion": 8,
90-
"publicationName": "android"
91-
},
9274
{
9375
"gradlePath": ":workflow-runtime",
9476
"group": "com.squareup.workflow1",
@@ -143,6 +125,15 @@
143125
"javaVersion": 8,
144126
"publicationName": "kotlinMultiplatform"
145127
},
128+
{
129+
"gradlePath": ":workflow-runtime-android",
130+
"group": "com.squareup.workflow1",
131+
"artifactId": "workflow-runtime-android",
132+
"description": "Workflow Runtime Android",
133+
"packaging": "aar",
134+
"javaVersion": 8,
135+
"publicationName": "maven"
136+
},
146137
{
147138
"gradlePath": ":workflow-rx2",
148139
"group": "com.squareup.workflow1",

samples/containers/hello-back-button/src/main/java/com/squareup/sample/hellobackbutton/AreYouSureWorkflow.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import com.squareup.workflow1.Snapshot
1010
import com.squareup.workflow1.StatefulWorkflow
1111
import com.squareup.workflow1.WorkflowAction.Companion.noAction
1212
import com.squareup.workflow1.action
13-
import com.squareup.workflow1.toParcelable
14-
import com.squareup.workflow1.toSnapshot
1513
import com.squareup.workflow1.ui.AndroidScreen
1614
import com.squareup.workflow1.ui.Screen
1715
import com.squareup.workflow1.ui.ScreenViewFactory
@@ -24,6 +22,8 @@ import com.squareup.workflow1.ui.navigation.AlertOverlay.Event.ButtonClicked
2422
import com.squareup.workflow1.ui.navigation.AlertOverlay.Event.Canceled
2523
import com.squareup.workflow1.ui.navigation.BackButtonScreen
2624
import com.squareup.workflow1.ui.navigation.BodyAndOverlaysScreen
25+
import com.squareup.workflow1.ui.toParcelable
26+
import com.squareup.workflow1.ui.toSnapshot
2727
import kotlinx.parcelize.Parcelize
2828

2929
/**

samples/containers/hello-back-button/src/main/java/com/squareup/sample/hellobackbutton/HelloBackButtonWorkflow.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import com.squareup.sample.hellobackbutton.HelloBackButtonWorkflow.State.Baker
77
import com.squareup.sample.hellobackbutton.HelloBackButtonWorkflow.State.Charlie
88
import com.squareup.workflow1.Snapshot
99
import com.squareup.workflow1.StatefulWorkflow
10-
import com.squareup.workflow1.toParcelable
11-
import com.squareup.workflow1.toSnapshot
10+
import com.squareup.workflow1.ui.toParcelable
11+
import com.squareup.workflow1.ui.toSnapshot
1212
import kotlinx.parcelize.Parcelize
1313

1414
object HelloBackButtonWorkflow : StatefulWorkflow<Unit, State, Nothing, HelloBackButtonScreen>() {

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ include(
6464
":workflow-config:config-jvm",
6565
":workflow-core",
6666
":workflow-runtime",
67+
":workflow-runtime-android",
6768
":workflow-rx2",
6869
":workflow-testing",
6970
":workflow-tracing",

workflow-config/config-android/dependencies/releaseRuntimeClasspath.txt

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,10 @@
1-
androidx.activity:activity-ktx:1.7.0
2-
androidx.activity:activity:1.7.0
3-
androidx.annotation:annotation-experimental:1.4.1
4-
androidx.annotation:annotation-jvm:1.8.1
5-
androidx.annotation:annotation:1.8.1
6-
androidx.arch.core:core-common:2.2.0
7-
androidx.arch.core:core-runtime:2.2.0
8-
androidx.autofill:autofill:1.0.0
9-
androidx.collection:collection-jvm:1.4.4
10-
androidx.collection:collection-ktx:1.4.4
11-
androidx.collection:collection:1.4.4
12-
androidx.compose.runtime:runtime-android:1.7.2
13-
androidx.compose.runtime:runtime-saveable-android:1.7.2
14-
androidx.compose.runtime:runtime-saveable:1.7.2
15-
androidx.compose.runtime:runtime:1.7.2
16-
androidx.compose.ui:ui-android:1.7.2
17-
androidx.compose.ui:ui-geometry-android:1.7.2
18-
androidx.compose.ui:ui-geometry:1.7.2
19-
androidx.compose.ui:ui-graphics-android:1.7.2
20-
androidx.compose.ui:ui-graphics:1.7.2
21-
androidx.compose.ui:ui-text-android:1.7.2
22-
androidx.compose.ui:ui-text:1.7.2
23-
androidx.compose.ui:ui-unit-android:1.7.2
24-
androidx.compose.ui:ui-unit:1.7.2
25-
androidx.compose.ui:ui-util-android:1.7.2
26-
androidx.compose.ui:ui-util:1.7.2
27-
androidx.compose:compose-bom:2024.09.02
28-
androidx.concurrent:concurrent-futures:1.1.0
29-
androidx.core:core-ktx:1.12.0
30-
androidx.core:core:1.12.0
31-
androidx.customview:customview-poolingcontainer:1.0.0
32-
androidx.emoji2:emoji2:1.2.0
33-
androidx.graphics:graphics-path:1.0.1
34-
androidx.interpolator:interpolator:1.0.0
35-
androidx.lifecycle:lifecycle-common-jvm:2.8.7
36-
androidx.lifecycle:lifecycle-common:2.8.7
37-
androidx.lifecycle:lifecycle-livedata-core:2.8.7
38-
androidx.lifecycle:lifecycle-process:2.8.7
39-
androidx.lifecycle:lifecycle-runtime-android:2.8.7
40-
androidx.lifecycle:lifecycle-runtime-compose-android:2.8.7
41-
androidx.lifecycle:lifecycle-runtime-compose:2.8.7
42-
androidx.lifecycle:lifecycle-runtime-ktx-android:2.8.7
43-
androidx.lifecycle:lifecycle-runtime-ktx:2.8.7
44-
androidx.lifecycle:lifecycle-runtime:2.8.7
45-
androidx.lifecycle:lifecycle-viewmodel-android:2.8.7
46-
androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7
47-
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.7
48-
androidx.lifecycle:lifecycle-viewmodel:2.8.7
49-
androidx.profileinstaller:profileinstaller:1.3.1
50-
androidx.savedstate:savedstate-ktx:1.2.1
51-
androidx.savedstate:savedstate:1.2.1
52-
androidx.startup:startup-runtime:1.1.1
53-
androidx.tracing:tracing:1.0.0
54-
androidx.versionedparcelable:versionedparcelable:1.1.1
55-
com.google.guava:listenablefuture:1.0
561
com.squareup.okio:okio-jvm:3.3.0
572
com.squareup.okio:okio:3.3.0
583
org.jetbrains.kotlin:kotlin-bom:2.0.21
594
org.jetbrains.kotlin:kotlin-stdlib-common:2.0.21
605
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.21
616
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21
627
org.jetbrains.kotlin:kotlin-stdlib:2.0.21
63-
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3
648
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
659
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
6610
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3

workflow-core/api/jvm/workflow-core.api renamed to workflow-core/api/workflow-core.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public final class com/squareup/workflow1/WorkflowIdentifier$Companion {
386386
public final fun parse (Lokio/ByteString;)Lcom/squareup/workflow1/WorkflowIdentifier;
387387
}
388388

389-
public final class com/squareup/workflow1/WorkflowIdentifierEx_jvmKt {
389+
public final class com/squareup/workflow1/WorkflowIdentifierExKt {
390390
public static final fun getWorkflowIdentifier (Lkotlin/reflect/KClass;)Lcom/squareup/workflow1/WorkflowIdentifier;
391391
}
392392

workflow-core/build.gradle.kts

Lines changed: 9 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
22

33
plugins {
44
id("kotlin-multiplatform")
5-
id("com.android.kotlin.multiplatform.library")
65
id("published")
76
}
87

@@ -14,63 +13,18 @@ kotlin {
1413
if (targets == "kmp" || targets == "jvm") {
1514
jvm { withJava() }
1615
}
17-
// The default KMP
18-
// ["hierarchy template"](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-hierarchy.html#see-the-full-hierarchy-template)
19-
// configures `androidMain` and `jvmMain` to be entirely separate targets, even though Android
20-
// *can* be made to be a child of JVM. Changing this requires completely wiring up all targets
21-
// ourselves though, so for now we've left them separate to simplify gradle config. If there ends
22-
// up being too much code duplication, we can either make `androidMain` a child of `jvmMain`, or
23-
// introduce a new shared target that includes both of them. Compose, for example, uses a
24-
// structure where `jvm` is the shared parent of both `android` and `desktop`.
25-
if (targets == "kmp" || targets == "android") {
26-
androidLibrary {
27-
namespace = "com.squareup.workflow1.android"
28-
testNamespace = "$namespace.test"
29-
30-
compileSdk = libs.versions.compileSdk.get().toInt()
31-
minSdk = libs.versions.minSdk.get().toInt()
32-
33-
withHostTestBuilder {
34-
}.configure {
35-
}
36-
37-
withDeviceTestBuilder {
38-
sourceSetTreeName = "test"
39-
}.configure {
40-
instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
41-
42-
// Disable transition and rotation animations.
43-
animationsDisabled = true
44-
}
45-
}
46-
}
4716
if (targets == "kmp" || targets == "js") {
4817
js(IR) { browser() }
4918
}
19+
}
5020

51-
sourceSets {
52-
commonMain {
53-
dependencies {
54-
api(libs.kotlin.jdk6)
55-
api(libs.kotlinx.coroutines.core)
56-
// For Snapshot.
57-
api(libs.squareup.okio)
58-
}
59-
}
60-
61-
commonTest {
62-
dependencies {
63-
implementation(libs.kotlinx.atomicfu)
64-
implementation(libs.kotlinx.coroutines.test.common)
65-
implementation(libs.kotlin.test.core)
66-
}
67-
}
21+
dependencies {
22+
commonMainApi(libs.kotlin.jdk6)
23+
commonMainApi(libs.kotlinx.coroutines.core)
24+
// For Snapshot.
25+
commonMainApi(libs.squareup.okio)
6826

69-
getByName("androidHostTest") {
70-
dependencies {
71-
implementation(libs.robolectric)
72-
implementation(libs.robolectric.annotations)
73-
}
74-
}
75-
}
27+
commonTestImplementation(libs.kotlinx.atomicfu)
28+
commonTestImplementation(libs.kotlinx.coroutines.test.common)
29+
commonTestImplementation(libs.kotlin.test.core)
7630
}

workflow-core/dependencies/androidRuntimeClasspath.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

workflow-core/src/androidHostTest/kotlin/com/squareup/workflow1/SnapshotParcelsTest.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.

workflow-core/src/androidMain/kotlin/com/squareup/workflow1/SnapshotParcels.kt

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)