Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pt. 2: Bump coroutines to 1.6.1 #723

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs :
gradle-dependencies-cache-key : |
gradle/libs.versions.toml
arguments : |
test apiCheck artifactsCheck lint ktlintCheck jmhJar --no-daemon --stacktrace --continue
test apiCheck artifactsCheck lint ktlintCheck jvmWorkflowNodeBenchmarkJar --no-daemon --stacktrace --continue
concurrent : true
gradle-build-scan-report : false
gradle-distribution-sha-256-sum-warning : false
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
buildscript {
dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.jmh.gradle.plugin)
classpath(libs.dokka.gradle.plugin)
classpath(libs.kotlin.serialization.gradle.plugin)
classpath(libs.kotlinx.binaryCompatibility.gradle.plugin)
classpath(libs.kotlinx.benchmark.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.google.ksp)
classpath(libs.ktlint.gradle)
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.parallel=true
android.useAndroidX=true
kotlin.mpp.stability.nowarn=true
# Uncomment this to diagnose "API $s is obsolete" warnings. Commented out b/c it's pretty noisy.
#android.debug.obsoleteApi=true

Expand Down
11 changes: 5 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ kotest = "5.1.0"
kotlin = "1.6.10"

kotlinx-binary-compatibility = "0.6.0"
kotlinx-coroutines = "1.5.1"
kotlinx-coroutines = "1.6.1"
kotlinx-serialization-json = "1.3.2"
kotlinx-benchmark = "0.4.2"

ktlint = "10.2.1"
material = "1.3.0"
Expand Down Expand Up @@ -87,6 +88,7 @@ google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp"}

kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinx-apiBinaryCompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-binary-compatibility" }
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-publish" }

Expand Down Expand Up @@ -154,11 +156,6 @@ hamcrest = "org.hamcrest:hamcrest-core:2.2"

jetbrains-annotations = "org.jetbrains:annotations:19.0.0"

jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
jmh-generator = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }

jmh-gradle-plugin = "me.champeau.gradle:jmh-gradle-plugin:0.5.3"

junit = { module = "junit:junit", version.ref = "jUnit" }

kotlin-common = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" }
Expand All @@ -178,6 +175,8 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
kotlinx-benchmark-gradle-plugin = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin", version.ref = "kotlinx-benchmark" }
kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }

ktlint-gradle = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" }

Expand Down
32 changes: 21 additions & 11 deletions samples/containers/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
plugins {
`java-library`
kotlin("jvm")
kotlin("multiplatform")
}

dependencies {
implementation(project(":workflow-ui:container-common"))
implementation(project(":workflow-core"))
kotlin {
jvm { withJava() }

implementation(libs.kotlin.jdk6)
sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":workflow-ui:container-common"))
implementation(project(":workflow-core"))

testImplementation(libs.kotlin.test.jdk)
testImplementation(libs.hamcrest)
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(project(":workflow-testing"))
implementation(libs.kotlin.jdk6)
}
}
val jvmTest by getting {
dependencies {
implementation(libs.kotlin.test.jdk)
implementation(libs.hamcrest)
implementation(libs.junit)
implementation(libs.truth)
implementation(project(":workflow-testing"))
}
}
}
}
30 changes: 20 additions & 10 deletions samples/dungeon/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
plugins {
`java-library`
kotlin("jvm")
kotlin("multiplatform")
id("kotlinx-serialization")
}

dependencies {
implementation(project(":workflow-ui:core-common"))
implementation(project(":workflow-core"))
kotlin {
jvm { withJava() }

implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlin.jdk8)
sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":workflow-ui:core-common"))
implementation(project(":workflow-core"))

testImplementation(project(":workflow-testing"))
testImplementation(libs.kotlin.test.jdk)
testImplementation(libs.truth)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlin.jdk8)
}
}
val jvmTest by getting {
dependencies {
implementation(project(":workflow-testing"))
implementation(libs.kotlin.test.jdk)
implementation(libs.truth)
}
}
}
}
31 changes: 20 additions & 11 deletions samples/dungeon/timemachine/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
plugins {
`java-library`
kotlin("jvm")
kotlin("multiplatform")
}

dependencies {
implementation(project(":workflow-core"))
kotlin {
jvm { withJava() }

implementation(libs.kotlin.jdk8)

testImplementation(libs.kotlin.test.jdk)
testImplementation(libs.hamcrest)
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(project(":workflow-testing"))
sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":workflow-core"))
implementation(libs.kotlin.jdk8)
}
}
val jvmTest by getting {
dependencies {
implementation(libs.kotlin.test.jdk)
implementation(libs.hamcrest)
implementation(libs.junit)
implementation(libs.truth)
implementation(project(":workflow-testing"))
}
}
}
}
18 changes: 13 additions & 5 deletions samples/hello-terminal/hello-terminal-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
plugins {
application
kotlin("jvm")
kotlin("multiplatform")
}

application.mainClassName = "com.squareup.sample.helloterminal.MainKt"

dependencies {
implementation(project(":samples:hello-terminal:terminal-workflow"))
implementation(project(":workflow-core"))
implementation(project(":workflow-runtime"))
kotlin {
jvm { withJava() }

sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":samples:hello-terminal:terminal-workflow"))
implementation(project(":workflow-core"))
implementation(project(":workflow-runtime"))
}
}
}
}
19 changes: 13 additions & 6 deletions samples/hello-terminal/terminal-workflow/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
plugins {
`java-library`
kotlin("jvm")
kotlin("multiplatform")
}

dependencies {
implementation(project(":workflow-core"))
implementation(project(":workflow-runtime"))
kotlin {
jvm { withJava() }

implementation(libs.lanterna)
sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":workflow-core"))
implementation(project(":workflow-runtime"))

implementation(libs.lanterna)
}
}
}
}
18 changes: 13 additions & 5 deletions samples/hello-terminal/todo-terminal-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
plugins {
application
kotlin("jvm")
kotlin("multiplatform")
}

application.mainClassName = "com.squareup.sample.hellotodo.MainKt"

dependencies {
implementation(project(":samples:hello-terminal:terminal-workflow"))
implementation(project(":workflow-core"))
implementation(project(":workflow-runtime"))
kotlin {
jvm { withJava() }

sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":samples:hello-terminal:terminal-workflow"))
implementation(project(":workflow-core"))
implementation(project(":workflow-runtime"))
}
}
}
}
34 changes: 22 additions & 12 deletions samples/tictactoe/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
plugins {
`java-library`
kotlin("jvm")
kotlin("multiplatform")
}

dependencies {
implementation(project(":samples:containers:common"))
implementation(project(":workflow-ui:container-common"))
implementation(project(":workflow-core"))
implementation(project(":workflow-rx2"))
kotlin {
jvm { withJava() }

implementation(libs.kotlin.jdk6)
sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":samples:containers:common"))
implementation(project(":workflow-ui:container-common"))
implementation(project(":workflow-core"))
implementation(project(":workflow-rx2"))

testImplementation(libs.hamcrest)
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(project(":workflow-testing"))
implementation(libs.kotlin.jdk6)
}
}
val jvmTest by getting {
dependencies {
implementation(libs.hamcrest)
implementation(libs.junit)
implementation(libs.truth)
implementation(project(":workflow-testing"))
}
}
}
}
8 changes: 6 additions & 2 deletions workflow-core/api/workflow-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public final class com/squareup/workflow1/BaseRenderContext$DefaultImpls {
public static synthetic fun renderChild$default (Lcom/squareup/workflow1/BaseRenderContext;Lcom/squareup/workflow1/Workflow;Ljava/lang/Object;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
}

public abstract interface class com/squareup/workflow1/HasWorkerType {
public abstract fun getWorkerType ()Lkotlin/reflect/KType;
}

public abstract interface class com/squareup/workflow1/ImpostorWorkflow {
public abstract fun describeRealIdentifier ()Ljava/lang/String;
public abstract fun getRealIdentifier ()Lcom/squareup/workflow1/WorkflowIdentifier;
Expand Down Expand Up @@ -184,11 +188,11 @@ public final class com/squareup/workflow1/Worker$DefaultImpls {
public static fun doesSameWorkAs (Lcom/squareup/workflow1/Worker;Lcom/squareup/workflow1/Worker;)Z
}

public final class com/squareup/workflow1/WorkerWorkflow : com/squareup/workflow1/StatefulWorkflow, com/squareup/workflow1/ImpostorWorkflow {
public final class com/squareup/workflow1/WorkerWorkflow : com/squareup/workflow1/StatefulWorkflow, com/squareup/workflow1/HasWorkerType, com/squareup/workflow1/ImpostorWorkflow {
public fun <init> (Lkotlin/reflect/KType;Ljava/lang/String;)V
public fun describeRealIdentifier ()Ljava/lang/String;
public fun getRealIdentifier ()Lcom/squareup/workflow1/WorkflowIdentifier;
public final fun getWorkerType ()Lkotlin/reflect/KType;
public fun getWorkerType ()Lkotlin/reflect/KType;
public fun initialState (Lcom/squareup/workflow1/Worker;Lcom/squareup/workflow1/Snapshot;)Ljava/lang/Integer;
public synthetic fun initialState (Ljava/lang/Object;Lcom/squareup/workflow1/Snapshot;)Ljava/lang/Object;
public fun onPropsChanged (Lcom/squareup/workflow1/Worker;Lcom/squareup/workflow1/Worker;I)Ljava/lang/Integer;
Expand Down
30 changes: 20 additions & 10 deletions workflow-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
`java-library`
kotlin("jvm")
kotlin("multiplatform")
id("org.jetbrains.dokka")
}

Expand All @@ -11,14 +10,25 @@ java {

apply(from = rootProject.file(".buildscript/configure-maven-publish.gradle"))

dependencies {
compileOnly(libs.jetbrains.annotations)
kotlin {
jvm { withJava() }

api(libs.kotlin.jdk6)
api(libs.kotlinx.coroutines.core)
// For Snapshot.
api(libs.squareup.okio)
sourceSets {
val jvmMain by getting {
dependencies {
compileOnly(libs.jetbrains.annotations)

testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.kotlin.test.jdk)
api(libs.kotlin.jdk6)
api(libs.kotlinx.coroutines.core)
// For Snapshot.
api(libs.squareup.okio)
}
}
val jvmTest by getting {
dependencies {
implementation(libs.kotlinx.coroutines.test)
implementation(libs.kotlin.test.jdk)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.squareup.workflow1

import kotlin.reflect.KType

/**
* So that we don't have to make [WorkerWorkflow] public. Xfriend-paths does not seem to work as a
* compiler arg on multiplatform projects.
*/
public interface HasWorkerType {
public val workerType: KType
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import kotlin.reflect.KType
* [BaseRenderContext.runningWorker]. Used for naming the worker's coroutine.
*/
internal class WorkerWorkflow<OutputT>(
val workerType: KType,
override val workerType: KType,
private val key: String
) : StatefulWorkflow<Worker<OutputT>, Int, OutputT, Unit>(),
ImpostorWorkflow {
ImpostorWorkflow,
HasWorkerType {

override val realIdentifier: WorkflowIdentifier = unsnapshottableIdentifier(workerType)
override fun describeRealIdentifier(): String = "worker $workerType"
Expand Down
Loading