Skip to content

Commit 709a3a4

Browse files
committed
Common flow moved to the next module
Refs: #11
1 parent 0349dcd commit 709a3a4

8 files changed

Lines changed: 159 additions & 2 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Grant execute permission for gradlew
3434
run: chmod +x gradlew
3535
- name: Check with gradle
36-
run: ./gradlew runUnitTests :examples:lce:assembleDebug :examples:welcome:welcome:assembleDebug :examples:multi:navbar:assembleDebug :examples:multi:parallel:assembleDebug :examples:lifecycle:assembleDebug --no-daemon --no-configuration-cache
36+
run: ./gradlew runUnitTests :examples:lce:assembleDebug :examples:welcome:welcome:assembleDebug :examples:multi:navbar:assembleDebug :examples:multi:parallel:assembleDebug :examples:lifecycle:assembleDebug :examples:di:app:assembleDebug --no-daemon --no-configuration-cache
3737
- name: Upload problems report
3838
uses: actions/upload-artifact@v4
3939
if: failure()

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commonflow/build.gradle.kts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/*
2+
* Copyright 2026 Nikolai Kotchetkov.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
14+
@file:Suppress("unused")
15+
@file:OptIn(ExperimentalWasmDsl::class)
16+
17+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
18+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
19+
20+
plugins {
21+
alias(libs.plugins.kotlin.multiplatform)
22+
alias(libs.plugins.android.kotlin.multiplatform.library)
23+
alias(libs.plugins.kotlin.dokka)
24+
id("maven-publish")
25+
id("signing")
26+
}
27+
28+
val versionName: String by project.extra
29+
val androidMinSdkVersion: Int by project.extra
30+
val androidTargetSdkVersion: Int by project.extra
31+
val androidCompileSdkVersion: Int by project.extra
32+
33+
group = rootProject.group
34+
version = rootProject.version
35+
36+
println("== Project version: $versionName ==")
37+
38+
kotlin {
39+
jvmToolchain(17)
40+
41+
jvm()
42+
android {
43+
namespace = "com.motorro.commonstatemachine.commonflow"
44+
compileSdk = androidCompileSdkVersion
45+
minSdk = androidMinSdkVersion
46+
47+
withHostTest {
48+
isIncludeAndroidResources = true
49+
}
50+
51+
compilerOptions {
52+
jvmTarget.set(JvmTarget.JVM_17)
53+
}
54+
}
55+
56+
js(IR) {
57+
binaries.library()
58+
useCommonJs()
59+
browser {
60+
testTask(Action {
61+
useMocha {
62+
timeout = "10s"
63+
}
64+
})
65+
}
66+
}
67+
68+
wasmJs {
69+
binaries.library()
70+
useCommonJs()
71+
browser {
72+
testTask(Action {
73+
useMocha {
74+
timeout = "10s"
75+
}
76+
})
77+
}
78+
}
79+
80+
listOf(
81+
iosX64(),
82+
iosArm64(),
83+
iosSimulatorArm64()
84+
).forEach {
85+
it.binaries.framework {
86+
baseName = "commonflow"
87+
isStatic = true
88+
}
89+
}
90+
91+
sourceSets {
92+
commonMain.dependencies {
93+
api(project(":commonstatemachine"))
94+
}
95+
}
96+
}
97+
val javadocJar by tasks.registering(Jar::class) {
98+
dependsOn(tasks.dokkaGenerate)
99+
group = "documentation"
100+
archiveClassifier.set("javadoc")
101+
from(tasks.dokkaGenerate)
102+
}
103+
104+
val libId = "commonflow"
105+
val libName = "commonflow"
106+
val libDesc = "Common flow for modularized state machines"
107+
val projectUrl: String by project.extra
108+
val projectScm: String by project.extra
109+
val ossrhUsername: String? by rootProject.extra
110+
val ossrhPassword: String? by rootProject.extra
111+
val developerId: String by project.extra
112+
val developerName: String by project.extra
113+
val developerEmail: String by project.extra
114+
val signingKey: String? by rootProject.extra
115+
val signingPassword: String? by rootProject.extra
116+
117+
publishing {
118+
publications.withType<MavenPublication> {
119+
artifact(javadocJar)
120+
pom {
121+
name.set(libName)
122+
description.set(libDesc)
123+
url.set(projectUrl)
124+
licenses {
125+
license {
126+
name.set("Apache-2.0")
127+
url.set("https://apache.org/licenses/LICENSE-2.0")
128+
}
129+
}
130+
developers {
131+
developer {
132+
id.set(developerId)
133+
name.set(developerName)
134+
email.set(developerEmail)
135+
}
136+
}
137+
scm {
138+
connection.set(projectScm)
139+
developerConnection.set(projectScm)
140+
url.set(projectUrl)
141+
}
142+
}
143+
}
144+
}
145+
146+
signing {
147+
useInMemoryPgpKeys(signingKey, signingPassword)
148+
sign(publishing.publications)
149+
}
150+
151+
val signingTasks = tasks.withType<Sign>()
152+
tasks.withType<AbstractPublishToMaven>().configureEach {
153+
dependsOn(signingTasks)
154+
}

commonstatemachine/src/commonMain/kotlin/com/motorro/commonstatemachine/flow/CommonFlowApi.kt renamed to commonflow/src/commonMain/kotlin/com/motorro/commonstatemachine/flow/CommonFlowApi.kt

File renamed without changes.

commonstatemachine/src/commonMain/kotlin/com/motorro/commonstatemachine/flow/CommonFlowHost.kt renamed to commonflow/src/commonMain/kotlin/com/motorro/commonstatemachine/flow/CommonFlowHost.kt

File renamed without changes.

examples/di/api/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dependencies {
6060
api(libs.timber)
6161

6262
api(project(":commonstatemachine"))
63+
api(project(":commonflow"))
6364

6465
coreLibraryDesugaring(libs.desugaring)
6566

examples/lifecycle/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
44

55

66
/*
7-
* Copyright 2023 Nikolai Kotchetkov.
7+
* Copyright 2026 Nikolai Kotchetkov.
88
* Licensed under the Apache License, Version 2.0 (the "License");
99
* you may not use this file except in compliance with the License.
1010
* You may obtain a copy of the License at

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ include(
3737
":tmap",
3838
":commonstatemachine",
3939
":coroutines",
40+
":commonflow",
4041
":examples:commoncore",
4142
":examples:androidcore",
4243
":examples:welcome:welcome",

0 commit comments

Comments
 (0)