Skip to content

Commit 8f9fb8c

Browse files
committed
Migrate :workflow-core and :workflow-runtime to kmp gradle plugin
1 parent 2cc1c4f commit 8f9fb8c

File tree

69 files changed

+117
-98
lines changed

Some content is hidden

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

69 files changed

+117
-98
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)

buildSrc/src/main/java/com/squareup/workflow1/buildsrc/KotlinCommonSettings.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ val Project.isRunningFromIde
1111

1212
@Suppress("SuspiciousCollectionReassignment")
1313
fun Project.kotlinCommonSettings(
14-
compileTask: KotlinCompile
14+
compileTask: KotlinCompile,
15+
configuration: String = "implementation",
1516
) {
1617

1718
// force the same Kotlin version everywhere, including transitive dependencies
1819
dependencies {
19-
"implementation"(platform(kotlin("bom")))
20+
configuration(platform(kotlin("bom")))
2021
}
2122

2223
compileTask.kotlinOptions {

buildSrc/src/main/java/kotlin-multiplatform.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ tasks.withType<KotlinCompile> {
1515
jvmTarget = "1.8"
1616
}
1717

18-
project.kotlinCommonSettings(this)
18+
project.kotlinCommonSettings(this, "commonMainImplementation")
1919
}

dependencies/classpath.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ com.squareup.retrofit2:converter-moshi:2.9.0
7373
com.squareup.retrofit2:retrofit:2.9.0
7474
com.squareup:javapoet:1.10.0
7575
com.squareup:javawriter:2.5.0
76+
com.squareup:kotlinpoet:1.3.0
7677
com.sun.activation:javax.activation:1.2.0
7778
com.sun.istack:istack-commons-runtime:3.0.8
7879
com.sun.xml.fastinfoset:FastInfoset:1.2.16
@@ -104,7 +105,6 @@ it.unimi.dsi:fastutil:8.4.0
104105
jakarta.activation:jakarta.activation-api:1.2.1
105106
jakarta.xml.bind:jakarta.xml.bind-api:2.3.2
106107
javax.inject:javax.inject:1
107-
me.champeau.gradle:jmh-gradle-plugin:0.5.3
108108
net.java.dev.jna:jna-platform:5.6.0
109109
net.java.dev.jna:jna:5.6.0
110110
net.sf.jopt-simple:jopt-simple:4.9
@@ -152,8 +152,10 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31
152152
org.jetbrains.kotlin:kotlin-stdlib:1.5.31
153153
org.jetbrains.kotlin:kotlin-tooling-metadata:1.6.10
154154
org.jetbrains.kotlin:kotlin-util-io:1.6.10
155+
org.jetbrains.kotlin:kotlin-util-klib-metadata:1.6.0
155156
org.jetbrains.kotlin:kotlin-util-klib:1.6.10
156157
org.jetbrains.kotlinx:binary-compatibility-validator:0.6.0
158+
org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.4.2
157159
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.1
158160
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1
159161
org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.2.0
@@ -164,7 +166,7 @@ org.jlleitschuh.gradle:ktlint-gradle:10.3.0
164166
org.json:json:20180813
165167
org.jsoup:jsoup:1.13.1
166168
org.jvnet.staxex:stax-ex:1.8.1
167-
org.openjdk.jmh:jmh-core:1.27
169+
org.openjdk.jmh:jmh-core:1.21
168170
org.ow2.asm:asm-analysis:9.1
169171
org.ow2.asm:asm-commons:9.1
170172
org.ow2.asm:asm-tree:9.1

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"
@@ -92,6 +93,7 @@ google-ksp = { id = "com.google.devtools.ksp", version.ref = "google-ksp" }
9293

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

@@ -163,11 +165,6 @@ hamcrest = "org.hamcrest:hamcrest-core:2.2"
163165

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

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

173170
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
@@ -188,6 +185,8 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
188185
kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinx-coroutines" }
189186
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
190187
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
188+
kotlinx-benchmark-gradle-plugin = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin", version.ref = "kotlinx-benchmark" }
189+
kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }
191190

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

workflow-core/build.gradle.kts

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

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

9-
dependencies {
10-
compileOnly(libs.jetbrains.annotations)
8+
kotlin {
9+
jvm { withJava() }
1110

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

17-
testImplementation(libs.kotlinx.coroutines.test)
18-
testImplementation(libs.kotlin.test.jdk)
16+
api(libs.kotlin.jdk6)
17+
api(libs.kotlinx.coroutines.core)
18+
// For Snapshot.
19+
api(libs.squareup.okio)
20+
}
21+
}
22+
val jvmTest by getting {
23+
dependencies {
24+
implementation(libs.kotlinx.coroutines.test)
25+
implementation(libs.kotlin.test.jdk)
26+
}
27+
}
28+
}
1929
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
com.squareup.okio:okio-jvm:3.0.0
2+
com.squareup.okio:okio:3.0.0
3+
org.jetbrains.kotlin:kotlin-bom:1.6.10
4+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10
5+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10
6+
org.jetbrains.kotlin:kotlin-stdlib:1.6.10
7+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.1
8+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1
9+
org.jetbrains:annotations:13.0

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)