Skip to content

Commit bc22897

Browse files
committed
Migrate :workflow-core and :workflow-runtime to kmp gradle plugin
1 parent c6a202a commit bc22897

File tree

64 files changed

+100
-73
lines changed

Some content is hidden

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

64 files changed

+100
-73
lines changed

.github/workflows/kotlin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs :
7878
gradle-dependencies-cache-key : |
7979
gradle/libs.versions.toml
8080
arguments : |
81-
test apiCheck artifactsCheck dependencyGuard lint ktlintCheck jmhJar --no-daemon --stacktrace --continue
81+
test apiCheck artifactsCheck dependencyGuard lint ktlintCheck jvmWorkflowNodeBenchmarkJar --no-daemon --stacktrace --continue
8282
concurrent : true
8383
gradle-build-scan-report : false
8484
gradle-distribution-sha-256-sum-warning : false

artifacts.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
{
1919
"gradlePath": ":workflow-core",
2020
"group": "com.squareup.workflow1",
21-
"artifactId": "workflow-core-jvm",
21+
"artifactId": "workflow-core",
2222
"description": "Workflow Core",
2323
"packaging": "jar",
2424
"javaVersion": "1.8"
2525
},
2626
{
2727
"gradlePath": ":workflow-runtime",
2828
"group": "com.squareup.workflow1",
29-
"artifactId": "workflow-runtime-jvm",
29+
"artifactId": "workflow-runtime",
3030
"description": "Workflow Runtime",
3131
"packaging": "jar",
3232
"javaVersion": "1.8"

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
55
buildscript {
66
dependencies {
77
classpath(libs.android.gradle.plugin)
8-
classpath(libs.jmh.gradle.plugin)
8+
classpath(libs.kotlinx.benchmark.gradle.plugin)
99
classpath(libs.dokka.gradle.plugin)
1010
classpath(libs.kotlin.serialization.gradle.plugin)
1111
classpath(libs.kotlinx.binaryCompatibility.gradle.plugin)

gradle/libs.versions.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ kotlin = "1.6.10"
5151
kotlinx-binary-compatibility = "0.6.0"
5252
kotlinx-coroutines = "1.5.1"
5353
kotlinx-serialization-json = "1.3.2"
54+
kotlinx-benchmark = "0.4.2"
5455

5556
ktlint = "10.3.0"
5657
material = "1.3.0"
@@ -93,6 +94,7 @@ google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" }
9394

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

@@ -164,11 +166,6 @@ hamcrest = "org.hamcrest:hamcrest-core:2.2"
164166

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

167-
jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
168-
jmh-generator = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }
169-
170-
jmh-gradle-plugin = "me.champeau.gradle:jmh-gradle-plugin:0.5.3"
171-
172169
junit = { module = "junit:junit", version.ref = "jUnit" }
173170

174171
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
@@ -189,6 +186,8 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
189186
kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinx-coroutines" }
190187
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
191188
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
189+
kotlinx-benchmark-gradle-plugin = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin", version.ref = "kotlinx-benchmark" }
190+
kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }
192191

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

workflow-core/api/workflow-core.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public final class com/squareup/workflow1/WorkflowAction$Companion {
219219

220220
public final class com/squareup/workflow1/WorkflowAction$Updater {
221221
public fun <init> (Lcom/squareup/workflow1/WorkflowAction;Ljava/lang/Object;Ljava/lang/Object;)V
222-
public final fun getMaybeOutput$wf1_workflow_core ()Lcom/squareup/workflow1/WorkflowOutput;
222+
public final fun getMaybeOutput$workflow_core ()Lcom/squareup/workflow1/WorkflowOutput;
223223
public final fun getProps ()Ljava/lang/Object;
224224
public final fun getState ()Ljava/lang/Object;
225225
public final fun setOutput (Ljava/lang/Object;)V

workflow-core/build.gradle.kts

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
plugins {
2-
`java-library`
3-
`kotlin-jvm`
2+
kotlin("multiplatform")
43
id("org.jetbrains.dokka")
54
}
65

6+
java {
7+
sourceCompatibility = JavaVersion.VERSION_1_8
8+
targetCompatibility = JavaVersion.VERSION_1_8
9+
}
10+
711
apply(from = rootProject.file(".buildscript/configure-maven-publish.gradle"))
812

9-
dependencies {
10-
compileOnly(libs.jetbrains.annotations)
13+
kotlin {
14+
jvm { withJava() }
1115

12-
api(libs.kotlin.jdk6)
13-
api(libs.kotlinx.coroutines.core)
14-
// For Snapshot.
15-
api(libs.squareup.okio)
16+
sourceSets {
17+
val jvmMain by getting {
18+
dependencies {
19+
compileOnly(libs.jetbrains.annotations)
1620

17-
testImplementation(libs.kotlinx.coroutines.test)
18-
testImplementation(libs.kotlin.test.jdk)
21+
api(libs.kotlin.jdk6)
22+
api(libs.kotlinx.coroutines.core)
23+
// For Snapshot.
24+
api(libs.squareup.okio)
25+
}
26+
}
27+
val jvmTest by getting {
28+
dependencies {
29+
implementation(libs.kotlinx.coroutines.test)
30+
implementation(libs.kotlin.test.jdk)
31+
}
32+
}
33+
}
1934
}

workflow-core/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
POM_ARTIFACT_ID=workflow-core-jvm
1+
POM_ARTIFACT_ID=workflow-core
22
POM_NAME=Workflow Core
33
POM_PACKAGING=jar

0 commit comments

Comments
 (0)