Skip to content

Commit 4855b91

Browse files
committed
Merge branch 'main' into rick/enable_ktlint_rules
* main: fix TextInputTest flakes remove unused KAPT from `:workflow-tracing` Use KSP instead of KAPT for Moshi's codegen Update Tutorial kdoc link Update RELEASING instructions and update Tutorial version Finish releasing v1.5.0 Release v1.5.0 Launch renderWorkflowIn CoroutineScope with Default; Fixes #643 Update comments in renderWorkflowIn Check if runtime CoroutineScope cancelled after nextOutput()
2 parents 3923141 + 153130a commit 4855b91

File tree

16 files changed

+74
-36
lines changed

16 files changed

+74
-36
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ your `repositories` block, and then add dependencies on the following artifacts:
6464
<td>Your Android app uses modals (popups).</td>
6565
</tr>
6666
<tr>
67-
<td nowrap><code>com.squareup.workflow1:workflow-ui-backstack-android:x.y.z</code></td>
67+
<td nowrap><code>com.squareup.workflow1:workflow-ui-container-android:x.y.z</code></td>
6868
<td>Your android app uses backstacks.</td>
6969
</tr>
7070
</table>

RELEASING.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
./gradlew build connectedCheck
1111
```
1212

13+
1. Update your tags.
14+
```bash
15+
git fetch --tags
16+
```
17+
1318
1. In `gradle.properties`, remove the `-SNAPSHOT` suffix from the `VERSION_NAME` property.
1419
E.g. `VERSION_NAME=0.1.0`
1520

@@ -38,11 +43,11 @@
3843
git commit -am "Finish releasing v0.1.0."
3944
```
4045

41-
1. Push your commits and tag:
46+
1. Push your commits and tags:
4247
```
43-
git push origin main
48+
git push origin main && git push --tags
4449
# or git push origin fix-branch
45-
git push origin v0.1.0
50+
git push origin v0.1.0 && git push --tags
4651
```
4752

4853
1. Create the release on GitHub:
@@ -119,6 +124,23 @@ mavenCentralUsername=<username>
119124
mavenCentralPassword=<password>
120125
```
121126

127+
In order to sign you'll need to specify your GPG key config in your private
128+
Gradle properties file(`~/.gradle/gradle.properties`).
129+
130+
```
131+
signing.keyId=<keyid>
132+
signing.password=<password>
133+
signing.secretKeyRingFile=<path/to/secring.gpg>
134+
```
135+
136+
If this is your first time for either, the following one time steps need
137+
to be performed:
138+
139+
1. Sign up for a Sonatype JIRA account.
140+
1. Generate a GPG key (if you don't already have one). [Instructions](https://central.sonatype.org/publish/requirements/gpg/#generating-a-key-pair).
141+
1. Distribute the GPG key to public servers. [Instructions](https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key).
142+
1. Get access to deploy under 'com.squareup' from Sonatype.
143+
122144
#### Snapshot Releases
123145

124146
Double-check that `gradle.properties` correctly contains the `-SNAPSHOT` suffix, then upload

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ buildscript {
1111
classpath(Dependencies.Kotlin.binaryCompatibilityValidatorPlugin)
1212
classpath(Dependencies.Kotlin.gradlePlugin)
1313
classpath(Dependencies.Kotlin.Serialization.gradlePlugin)
14+
classpath(Dependencies.ksp)
1415
classpath(Dependencies.ktlint)
1516
classpath(Dependencies.mavenPublish)
1617
}

buildSrc/src/main/java/Dependencies.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ object Dependencies {
110110
}
111111

112112
const val mavenPublish = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
113+
const val ksp = "com.google.devtools.ksp:symbol-processing-gradle-plugin:1.6.10-1.0.2"
113114
const val ktlint = "org.jlleitschuh.gradle:ktlint-gradle:10.2.1"
114115
const val lanterna = "com.googlecode.lanterna:lanterna:3.1.1"
115116
const val okio = "com.squareup.okio:okio:2.10.0"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android.useAndroidX=true
88
systemProp.org.gradle.internal.publish.checksums.insecure=true
99

1010
GROUP=com.squareup.workflow1
11-
VERSION_NAME=1.5.0-SNAPSHOT
11+
VERSION_NAME=1.6.0-SNAPSHOT
1212

1313
POM_DESCRIPTION=Square Workflow
1414

samples/compose-samples/src/androidTest/java/com/squareup/sample/compose/textinput/TextInputTest.kt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
package com.squareup.sample.compose.textinput
22

3-
import androidx.compose.ui.semantics.SemanticsProperties.EditableText
43
import androidx.compose.ui.test.ExperimentalTestApi
5-
import androidx.compose.ui.test.SemanticsMatcher.Companion.expectValue
6-
import androidx.compose.ui.test.assert
74
import androidx.compose.ui.test.assertTextEquals
85
import androidx.compose.ui.test.hasSetTextAction
96
import androidx.compose.ui.test.junit4.createAndroidComposeRule
107
import androidx.compose.ui.test.onNodeWithText
118
import androidx.compose.ui.test.performClick
129
import androidx.compose.ui.test.performTextInput
1310
import androidx.compose.ui.test.performTextReplacement
14-
import androidx.compose.ui.text.AnnotatedString
1511
import androidx.test.ext.junit.runners.AndroidJUnit4
1612
import com.squareup.workflow1.ui.WorkflowUiExperimentalApi
1713
import com.squareup.workflow1.ui.internal.test.IdleAfterTestRule
@@ -33,22 +29,25 @@ class TextInputTest {
3329
@OptIn(ExperimentalTestApi::class)
3430
@Test fun allowsTextEditing() {
3531
composeRule.onNode(hasSetTextAction()).performTextInput("he")
36-
composeRule.onNode(hasSetTextAction()).assert(hasEditableTextEqualTo("he"))
32+
composeRule.onNode(hasSetTextAction()).assertTextEquals("he")
3733

3834
// For some reason performTextInput("llo") is flaky when running all the tests in this module.
3935
composeRule.onNode(hasSetTextAction())
4036
.performTextReplacement("hello")
41-
composeRule.onNode(hasSetTextAction()).assert(hasEditableTextEqualTo("hello"))
37+
composeRule.onNode(hasSetTextAction()).assertTextEquals("hello")
4238
}
4339

4440
@Test fun swapsText() {
4541
composeRule.onNode(hasSetTextAction()).performTextInput("hello")
46-
composeRule.onNode(hasSetTextAction()).assert(hasEditableTextEqualTo("hello"))
42+
composeRule.onNode(hasSetTextAction()).assertTextEquals("hello")
4743

4844
// Swap to empty field.
4945
composeRule.onNodeWithText("Swap").performClick()
5046

51-
composeRule.onNode(hasSetTextAction()).assert(hasEditableTextEqualTo(""))
47+
// The EditableText is empty, but it's showing a hint of `Enter some text`.
48+
// Even though the actual EditableText is blank/empty, if it's included, the assertion fails.
49+
composeRule.onNode(hasSetTextAction())
50+
.assertTextEquals("Enter some text", includeEditableText = false)
5251
composeRule.onNodeWithText("hello").assertDoesNotExist()
5352

5453
composeRule.onNode(hasSetTextAction()).performTextInput("world")
@@ -57,10 +56,7 @@ class TextInputTest {
5756
// Swap back to first field.
5857
composeRule.onNodeWithText("Swap").performClick()
5958

60-
composeRule.onNode(hasSetTextAction()).assert(hasEditableTextEqualTo("hello"))
59+
composeRule.onNode(hasSetTextAction()).assertTextEquals("hello")
6160
composeRule.onNodeWithText("world").assertDoesNotExist()
6261
}
63-
64-
private fun hasEditableTextEqualTo(text: String) =
65-
expectValue(EditableText, AnnotatedString(text))
6662
}

samples/tutorial/Tutorial2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ object RootWorkflow : StatefulWorkflow<Unit, State, Nothing, Any>() {
489489

490490
### Back Stack and "Containers"
491491

492-
We want to animate changes between our screens. Because we want all of our navigation state to be declarative, we need to use the [`BackStackScreen`](https://square.github.io/workflow/kotlin/api/workflow/com.squareup.workflow1.ui.backstack/-back-stack-screen/) to do this:
492+
We want to animate changes between our screens. Because we want all of our navigation state to be declarative, we need to use the [`BackStackScreen`](https://square.github.io/workflow/kotlin/api/gfmCollector/workflow/com.squareup.workflow1.ui.backstack/-back-stack-screen/) to do this:
493493

494494
```kotlin
495495
class BackStackScreen<StackedT : Any>(
@@ -504,12 +504,12 @@ class BackStackScreen<StackedT : Any>(
504504
}
505505
```
506506

507-
The `BackStackScreen` contains a list of all screens in the back stack that are specified on each render pass. `BackStackScreen` is part of the `workflow-ui-backstack-android` artifact. Update `build.gradle` to include this dependency:
507+
The `BackStackScreen` contains a list of all screens in the back stack that are specified on each render pass. `BackStackScreen` is part of the `workflow-ui-container-android` artifact. Update `build.gradle` to include this dependency:
508508

509509
```groovy
510510
dependencies {
511511
// ...
512-
implementation deps.workflow.backstack_android
512+
implementation deps.workflow.container_android
513513
implementation deps.workflow.core_android
514514
}
515515
```

samples/tutorial/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44
buildscript {
55
ext {
66
kotlin_version = "1.6.10"
7-
workflow_version = "1.0.0"
7+
workflow_version = "1.5.0"
88

99
deps = [
1010
activityktx: 'androidx.activity:activity-ktx:1.3.0',
@@ -23,7 +23,7 @@ buildscript {
2323
viewmodelsavedstate: 'androidx.lifecycle:lifecycle-viewmodel-savedstate:1.1.0',
2424
workflow: [
2525
core_android: "com.squareup.workflow1:workflow-ui-core-android:$workflow_version",
26-
backstack_android: "com.squareup.workflow1:workflow-ui-backstack-android:$workflow_version",
26+
container_android: "com.squareup.workflow1:workflow-ui-container-android:$workflow_version",
2727
testing: "com.squareup.workflow1:workflow-testing-jvm:$workflow_version",
2828
],
2929
]

samples/tutorial/tutorial-2-complete/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
implementation deps.appcompat
3131
implementation deps.kotlin.stdlib
3232
implementation deps.material
33-
implementation deps.workflow.backstack_android
33+
implementation deps.workflow.container_android
3434
implementation deps.viewmodelktx
3535
implementation deps.viewmodelsavedstate
3636
implementation deps.material

samples/tutorial/tutorial-3-complete/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
implementation deps.appcompat
3131
implementation deps.kotlin.stdlib
3232
implementation deps.material
33-
implementation deps.workflow.backstack_android
33+
implementation deps.workflow.container_android
3434
implementation deps.viewmodelktx
3535
implementation deps.viewmodelsavedstate
3636
implementation deps.material

0 commit comments

Comments
 (0)