Skip to content

Commit cfcd9b2

Browse files
WIP: Molecule Addition
1 parent a257760 commit cfcd9b2

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ buildscript {
1010
classpath(libs.kotlin.serialization.gradle.plugin)
1111
classpath(libs.kotlinx.binaryCompatibility.gradle.plugin)
1212
classpath(libs.kotlin.gradle.plugin)
13+
classpath(libs.molecule.gradle.plugin)
1314
classpath(libs.google.ksp)
1415
classpath(libs.ktlint.gradle)
1516
classpath(libs.vanniktech.publish)
@@ -19,6 +20,9 @@ buildscript {
1920
mavenCentral()
2021
gradlePluginPortal()
2122
google()
23+
maven {
24+
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
25+
}
2226
// For binary compatibility validator.
2327
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
2428
}

buildSrc/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ plugins {
77
repositories {
88
mavenCentral()
99
google()
10+
// For molecule SNAPSHOT
11+
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/")}
1012
}
1113

1214
dependencies {

gradle/libs.versions.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ targetSdk = "30"
99
androidx-activity = "1.3.0"
1010
androidx-appcompat = "1.3.1"
1111
androidx-benchmark = "1.1.0-rc03"
12-
androidx-compose = "1.1.0-rc01"
13-
androidx-compose-compiler = "1.1.0-rc02"
12+
androidx-compose = "1.1.0"
13+
androidx-compose-compiler = "1.1.0"
1414
androidx-constraintlayout = "2.1.2"
1515
androidx-core = "1.6.0"
1616
androidx-fragment = "1.3.6"
@@ -49,8 +49,8 @@ kotest = "5.1.0"
4949
kotlin = "1.6.10"
5050

5151
kotlinx-binary-compatibility = "0.6.0"
52-
kotlinx-coroutines = "1.5.1"
53-
# The 1.5.1 test artifact is jvm-only. The commonTest module should use 1.6.1.
52+
kotlinx-coroutines = "1.5.2"
53+
# The 1.5.2 test artifact is jvm-only. The commonTest module should use 1.6.1.
5454
kotlinx-coroutines-test-common = "1.6.1"
5555
kotlinx-serialization-json = "1.3.2"
5656
kotlinx-benchmark = "0.4.2"
@@ -64,6 +64,9 @@ mockito-core = "3.3.3"
6464
mockito-kotlin = "3.2.0"
6565

6666
mockk = "1.11.0"
67+
68+
molecule = "0.3.0-SNAPSHOT"
69+
6770
robolectric = "4.6.1"
6871

6972
rxjava2-android = "2.1.1"
@@ -100,8 +103,12 @@ kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kot
100103
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
101104
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-publish" }
102105

106+
molecule = { id = "app.cash.molecule", version.ref = "molecule"}
107+
103108
[libraries]
104109

110+
molecule-gradle-plugin = { module = "app.cash.molecule:molecule-gradle-plugin", version.ref = "molecule"}
111+
105112
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "androidTools" }
106113

107114
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }

settings.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pluginManagement {
99
google()
1010
// For binary compatibility validator.
1111
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
12+
// For molecule SNAPSHOT
13+
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/")}
1214
}
1315
}
1416

@@ -29,6 +31,8 @@ dependencyResolutionManagement {
2931
repositories {
3032
mavenCentral()
3133
google()
34+
// For molecule SNAPSHOT
35+
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/")}
3236
// See androidx.dev (can use this for Snapshot builds of AndroidX)
3337
// maven { url = java.net.URI.create("https://androidx.dev/snapshots/builds/8224905/artifacts/repository") }
3438
}

workflow-runtime/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
`kotlin-multiplatform`
66
id("org.jetbrains.dokka")
77
id("org.jetbrains.kotlinx.benchmark")
8+
id("app.cash.molecule")
89
}
910

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

workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/RenderWorkflow.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ public fun <PropsT, OutputT, RenderingT> renderWorkflowIn(
133133
}
134134
)
135135

136+
scope.launchMolecule {}
137+
136138
scope.launch {
137139
while (isActive) {
138140
// It might look weird to start by consuming the output before getting the rendering below,

0 commit comments

Comments
 (0)