Skip to content

Commit 384d9f5

Browse files
committed
chore: dependency graph, add molecule
1 parent 896dd28 commit 384d9f5

File tree

6 files changed

+74
-3
lines changed

6 files changed

+74
-3
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ $ ./gradlew :backend:run
3737
$ ./gradlew :web:jsBrowserProductionRun
3838
$ ./gradlew :benchmarks:benchmark
3939
$ ./gradlew publishMavenPublicationToLocalRepository
40+
$ ./gradlew createModuleGraph
4041
```
4142

4243
</details>
@@ -53,6 +54,9 @@ $ ./gradlew publishMavenPublicationToLocalRepository
5354
- [🎨 Compose Multiplatform Template](https://github.com/JetBrains/compose-multiplatform-template)
5455
- [📏 Compose Lint Rules](https://slackhq.github.io/compose-lints/rules/)
5556

57+
<!-- ToDO
58+
* Kotlin Compiler Plugin - https://github.com/Foso/KotlinCompilerPluginExample
59+
-->
5660

5761
<!-- Badges -->
5862

@@ -101,3 +105,32 @@ $ ./gradlew publishMavenPublicationToLocalRepository
101105
[Kotlin Multiplatform DSL]: https://kotlinlang.org/docs/multiplatform-dsl-reference.html
102106

103107
[simple-icons-logo]: https://simpleicons.org/icons/kotlin.svg
108+
109+
110+
### Module Dependency
111+
112+
```mermaid
113+
%%{
114+
init: {
115+
'theme': 'neutral'
116+
}
117+
}%%
118+
119+
graph LR
120+
121+
subgraph compose
122+
desktop
123+
web
124+
end
125+
subgraph dep-mgmt
126+
bom
127+
catalog
128+
end
129+
web --> common
130+
web --> common
131+
desktop --> common
132+
backend --> common
133+
web --> common
134+
benchmarks --> common
135+
136+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package dev.suresh.flow
2+
3+
// import androidx.compose.runtime.*
4+
// import app.cash.molecule.RecompositionMode
5+
// import app.cash.molecule.moleculeFlow
6+
// import kotlinx.coroutines.delay
7+
//
8+
//
9+
// @Composable
10+
// fun counter(start: Int = 0): Int {
11+
// var count by remember { mutableStateOf(start) }
12+
// LaunchedEffect(Unit) {
13+
// while (true) {
14+
// delay(1000)
15+
// count++
16+
// }
17+
// }
18+
// return count
19+
// }
20+
//
21+
// fun countFlow(start: Int = 0) = moleculeFlow(RecompositionMode.Immediate) {
22+
// counter(start)
23+
// }

gradle/build-logic/common-plugins/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ dependencies {
120120
implementation(libs.build.cyclonedx.plugin)
121121
implementation(libs.build.foojay.resolver)
122122
implementation(libs.build.nativeimage.plugin)
123+
implementation(libs.build.modulegraph.plugin)
123124
testImplementation(gradleTestKit())
124-
125+
// implementation(libs.build.cash.molecule.plugin)
125126
// implementation(libs.build.mokkery.plugin)
126127
// implementation(libs.build.jte.plugin)
127128
// implementation(libs.build.includegit.plugin)

gradle/build-logic/common-plugins/src/main/kotlin/plugins/kotlin.mpp.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ plugins {
2020
id("dev.zacsweers.redacted")
2121
id("org.jetbrains.dokka")
2222
id("org.jetbrains.kotlinx.kover")
23+
// id("app.cash.molecule")
2324
// id("dev.mokkery")
2425
}
2526

@@ -141,6 +142,7 @@ kotlinMultiplatform.apply {
141142
dependencies {
142143
implementation(kotlin("test"))
143144
implementation(libs.kotlinx.coroutines.test)
145+
implementation(libs.cash.turbine)
144146
}
145147
}
146148

gradle/build-logic/common-plugins/src/main/kotlin/plugins/misc.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import org.gradle.kotlin.dsl.*
66
plugins {
77
java
88
wrapper
9-
// id("plugins.common")
10-
// id("gg.jte.gradle")
119
id("com.diffplug.spotless")
1210
id("com.github.ben-manes.versions")
11+
id("dev.iurysouza.modulegraph")
12+
// id("plugins.common")
13+
// id("gg.jte.gradle")
1314
}
1415

1516
// jte {
@@ -54,6 +55,11 @@ spotless {
5455
}
5556
}
5657

58+
moduleGraphConfig {
59+
readmePath = "./README.md"
60+
heading = "### Module Dependency"
61+
}
62+
5763
tasks {
5864
// Dependency version updates
5965
dependencyUpdates {

gradle/libs.versions.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ kotlin-logging = "5.0.0"
7575
kotlin-bignum = "0.3.8"
7676
kotlin-diff = "0.4.0"
7777
kotlin-retry = "1.0.9"
78+
cash-molecule = "1.0.0"
79+
cash-turbine = "1.0.0"
7880
kmp-store5 = "5.0.0-beta01"
7981
kmp-settings = "1.0.0"
8082
parsus = "0.4.0"
@@ -110,6 +112,7 @@ poko-plugin = "0.14.0"
110112
buildkonfig = "0.13.3"
111113
gmazzo-buildconfig = "3.1.0"
112114
cyclonedx-plugin = "1.7.4"
115+
modulegraph = "0.4.0"
113116

114117

115118
[libraries]
@@ -146,6 +149,8 @@ build-compose-mpp = { module = "org.jetbrains.compose:compose-grad
146149
build-buildkonfig-plugin = { module = "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin" , version.ref = "buildkonfig"}
147150
build-gmazzo-buildconfig = { module = "com.github.gmazzo.buildconfig:plugin" , version.ref = "gmazzo-buildconfig"}
148151
build-mokkery-plugin = { module = "dev.mokkery:mokkery-gradle" , version.ref = "mokkery"}
152+
build-cash-molecule-plugin = { module = "app.cash.molecule:molecule-gradle-plugin" , version.ref = "cash-molecule"}
153+
build-modulegraph-plugin = { module = "dev.iurysouza:modulegraph" , version.ref = "modulegraph"}
149154

150155
# Gradle Dependencies
151156
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom" , version.ref = "kotlin"}
@@ -224,6 +229,7 @@ kotlin-codepoints-deluxe = { module = "de.cketti.unicode:kotlin-codepoint
224229
kotlin-diff = { module = "io.github.petertrr:kotlin-multiplatform-diff" , version.ref = "kotlin-diff"}
225230
kotlinx-uuid = { module = "app.softwork:kotlinx-uuid-core" , version.ref = "kotlinx-uuid" }
226231
benasher44-uuid = { module = "com.benasher44:uuid" , version.ref = "benasher44-uuid" }
232+
cash-turbine = { module = "app.cash.turbine:turbine" , version.ref = "cash-turbine" }
227233
store5 = { module = "org.mobilenativefoundation.store:store5" , version.ref = "kmp-store5" }
228234
parsus = { module = "me.alllex.parsus:parsus" , version.ref = "parsus" }
229235
cache4k = { module = "io.github.reactivecircus.cache4k:cache4k" , version.ref = "cache4k" }

0 commit comments

Comments
 (0)