Skip to content

Commit fc9e379

Browse files
Merge pull request #1370 from square/zachklipp/runtime-android
Move workflow-runtime-android into android source set in workflow-runtime module.
2 parents f4e1297 + 79354e3 commit fc9e379

File tree

29 files changed

+200
-107
lines changed

29 files changed

+200
-107
lines changed

artifacts.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@
7171
"javaVersion": 8,
7272
"publicationName": "kotlinMultiplatform"
7373
},
74+
{
75+
"gradlePath": ":workflow-runtime",
76+
"group": "com.squareup.workflow1",
77+
"artifactId": "workflow-runtime-android",
78+
"description": "Workflow Runtime",
79+
"packaging": "aar",
80+
"javaVersion": 8,
81+
"publicationName": "android"
82+
},
7483
{
7584
"gradlePath": ":workflow-runtime",
7685
"group": "com.squareup.workflow1",
@@ -125,15 +134,6 @@
125134
"javaVersion": 8,
126135
"publicationName": "kotlinMultiplatform"
127136
},
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-
},
137137
{
138138
"gradlePath": ":workflow-rx2",
139139
"group": "com.squareup.workflow1",

settings.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ include(
6464
":workflow-config:config-jvm",
6565
":workflow-core",
6666
":workflow-runtime",
67-
":workflow-runtime-android",
6867
":workflow-rx2",
6968
":workflow-testing",
7069
":workflow-tracing",

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,66 @@
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
156
com.squareup.okio:okio-jvm:3.3.0
257
com.squareup.okio:okio:3.3.0
358
org.jetbrains.kotlin:kotlin-bom:2.0.21
459
org.jetbrains.kotlin:kotlin-stdlib-common:2.0.21
560
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.21
661
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21
762
org.jetbrains.kotlin:kotlin-stdlib:2.0.21
63+
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3
864
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3
965
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3
1066
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3

workflow-runtime-android/README.md

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

workflow-runtime-android/api/workflow-runtime-android.api

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

workflow-runtime-android/build.gradle.kts

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

workflow-runtime-android/gradle.properties

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

workflow-runtime/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This module contains the core APIs and logic for running workflows.
55
## Kotlin Multiplatform
66

77
This module is a Kotlin Multiplatform module. The targets currently included for build and test
8-
are `jvm`, `ios`, and `iosSimulatorSimulatorArm64`. If you are having issues with the tests,
9-
ensure you have the correct version of XCode installed and can launch a simulator as it's specified
10-
in the gradle build file (Currently iPhone 14).
8+
are `jvm`, `android`, `ios`, and `iosSimulatorSimulatorArm64`. If you are having issues with the
9+
tests, ensure you have the correct version of XCode installed and can launch a simulator as it's
10+
specified in the gradle build file (Currently iPhone 14).
1111

1212
You can also choose to specify your targets for build and test with the property `workflow.targets`
13-
as either `kmp`, `jvm`, `ios`, `js`. The default is `kmp` (all the targets). Set this in your
14-
global `~/.gradle/gradle.properties` or specify the property in your gradle command, e.g.:
13+
as either `kmp`, `jvm`, `android`, `ios`, `js`. The default is `kmp` (all the targets). Set this in
14+
your global `~/.gradle/gradle.properties` or specify the property in your gradle command, e.g.:
1515

1616
```bash
1717
./gradlew build -Pworkflow.targets=jvm

workflow-runtime/build.gradle.kts

Lines changed: 71 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,94 @@
1+
import com.android.build.api.dsl.androidLibrary
12
import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
23

34
plugins {
45
id("kotlin-multiplatform")
6+
id("com.android.kotlin.multiplatform.library")
57
id("published")
68
id("app.cash.burst")
79
}
810

911
kotlin {
12+
// Needed for expect class Lock, which is not public API, so this doesn't add any binary compat
13+
// risk.
14+
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
15+
1016
val targets = project.findProperty("workflow.targets") ?: "kmp"
1117
if (targets == "kmp" || targets == "ios") {
1218
iosWithSimulatorArm64()
1319
}
1420
if (targets == "kmp" || targets == "jvm") {
1521
jvm {}
1622
}
23+
if (targets == "kmp" || targets == "android") {
24+
androidLibrary {
25+
namespace = "com.squareup.workflow1.android"
26+
testNamespace = "$namespace.test"
27+
28+
compileSdk = libs.versions.compileSdk.get().toInt()
29+
minSdk = libs.versions.minSdk.get().toInt()
30+
31+
withDeviceTestBuilder {
32+
sourceSetTreeName = "test"
33+
}.configure {
34+
instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
35+
36+
// Disable transition and rotation animations.
37+
animationsDisabled = true
38+
}
39+
}
40+
}
1741
if (targets == "kmp" || targets == "js") {
1842
js(IR) { browser() }
1943
}
2044

21-
// Needed for expect class Lock, which is not public API, so this doesn't add any binary compat
22-
// risk.
23-
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
24-
}
45+
sourceSets {
46+
commonMain {
47+
dependencies {
48+
api(project(":workflow-core"))
49+
api(libs.kotlinx.coroutines.core)
50+
}
51+
}
52+
53+
commonTest {
54+
dependencies {
55+
implementation(libs.kotlinx.coroutines.test.common)
56+
implementation(libs.kotlin.test.core)
57+
}
58+
}
59+
60+
androidMain {
61+
dependencies {
62+
// Add Android-specific dependencies here. Note that this source set depends on
63+
// commonMain by default and will correctly pull the Android artifacts of any KMP
64+
// dependencies declared in commonMain.
65+
val composeBom = project.dependencies.platform(libs.androidx.compose.bom)
2566

26-
dependencies {
27-
commonMainApi(project(":workflow-core"))
28-
commonMainApi(libs.kotlinx.coroutines.core)
67+
api(libs.androidx.compose.ui.android)
68+
api(libs.androidx.lifecycle.viewmodel.savedstate)
2969

30-
commonTestImplementation(libs.kotlinx.coroutines.test.common)
31-
commonTestImplementation(libs.kotlin.test.core)
70+
implementation(composeBom)
71+
}
72+
}
73+
74+
getByName("androidDeviceTest") {
75+
dependencies {
76+
implementation(project(":workflow-ui:internal-testing-android"))
77+
78+
implementation(libs.androidx.test.espresso.core)
79+
implementation(libs.androidx.test.junit)
80+
implementation(libs.squareup.leakcanary.instrumentation)
81+
82+
implementation(libs.androidx.activity.ktx)
83+
implementation(libs.androidx.lifecycle.viewmodel.ktx)
84+
implementation(libs.androidx.test.core)
85+
implementation(libs.androidx.test.truth)
86+
implementation(libs.kotlin.test.core)
87+
implementation(libs.kotlin.test.jdk)
88+
implementation(libs.kotlinx.coroutines.android)
89+
implementation(libs.kotlinx.coroutines.test)
90+
implementation(libs.squareup.papa)
91+
}
92+
}
93+
}
3294
}

0 commit comments

Comments
 (0)