Skip to content

Commit 2f73959

Browse files
authored
Prepare for 2.0 (#453)
1 parent 9bd3b3c commit 2f73959

File tree

6 files changed

+87
-74
lines changed

6 files changed

+87
-74
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
distribution: 'zulu'
2828
java-version: 20
2929
- uses: gradle/actions/setup-gradle@v3
30-
- run: ./gradlew build assembleAndroidTest dokkaHtmlMultiModule
30+
- run: ./gradlew build assembleAndroidTest dokkaHtml
3131

3232
- name: Run Tests
3333
uses: reactivecircus/android-emulator-runner@v2
@@ -47,6 +47,6 @@ jobs:
4747
with:
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949
BRANCH: site
50-
FOLDER: build/dokka/htmlMultiModule
50+
FOLDER: molecule-runtime/build/dokka/html
5151
TARGET_FOLDER: docs/latest/
5252
CLEAN: true

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
distribution: 'zulu'
1717
java-version: 20
1818
- uses: gradle/actions/setup-gradle@v3
19-
- run: ./gradlew publish dokkaHtmlMultiModule
19+
- run: ./gradlew publish dokkaHtml
2020
env:
2121
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
2222
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
@@ -38,6 +38,6 @@ jobs:
3838
with:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
BRANCH: site
41-
FOLDER: build/dokka/htmlMultiModule
42-
TARGET_FOLDER: docs/1.x/
41+
FOLDER: molecule-runtime/build/dokka/html
42+
TARGET_FOLDER: docs/2.x/
4343
CLEAN: true

CHANGELOG.md

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,77 @@
33
## [Unreleased]
44

55
New:
6-
- Nothing yet!
6+
- Support for Kotlin 2.0.0!
77

88
Changed:
9-
- Nothing yet!
9+
- Remove our Gradle plugin in favor of JetBrains' (see below for more).
1010

1111
Fixed:
12-
- Nothing yet!
12+
- Mac OS `DisplayLinkClock` was updated to correctly use a "static" function for pointer-passing to `CVDisplayLink`, as newly-enforced by Kotlin 2.0. This should not cause a behavior change.
13+
14+
15+
### Gradle plugin removed
16+
17+
This version of Molecule removes the custom Gradle plugin in favor of [the official JetBrains Compose compiler plugin](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compiler.html) which ships as part of Kotlin itself.
18+
Each module in which you had previously applied the `app.cash.molecule` plugin should be changed to apply `org.jetbrains.kotlin.plugin.compose` instead.
19+
The Molecule runtime will no longer be added as a result of the plugin change, and so any module which references Molecule APIs like `launchMolecule` should apply the `app.cash.molecule:molecule-runtime` dependency.
20+
21+
For posterity, the Kotlin version compatibility table and compiler version customization for our old Molecule Gradle plugin will be archived here:
22+
23+
<details>
24+
<summary>Molecule 1.x Gradle plugin Kotlin compatibility table</summary>
25+
<p>
26+
27+
Since Kotlin compiler plugins are an unstable API, certain versions of Molecule only work with
28+
certain versions of Kotlin.
29+
30+
| Kotlin | Molecule |
31+
|--------|----------------|
32+
| 1.9.24 | 1.4.3 |
33+
| 1.9.23 | 1.4.2 |
34+
| 1.9.22 | 1.3.2 - 1.4.1 |
35+
| 1.9.21 | 1.3.1 |
36+
| 1.9.20 | 1.3.0 |
37+
| 1.9.10 | 1.2.1 |
38+
| 1.9.0 | 1.1.0 - 1.2.0 |
39+
| 1.8.22 | 0.11.0 - 1.0.0 |
40+
| 1.8.21 | 0.10.0 |
41+
| 1.8.20 | 0.9.0 |
42+
| 1.8.10 | 0.8.0 |
43+
| 1.8.0 | 0.7.0 - 0.7.1 |
44+
| 1.7.20 | 0.6.0 - 0.6.1 |
45+
| 1.7.10 | 0.4.0 - 0.5.0 |
46+
| 1.7.0 | 0.3.0 - 0.3.1 |
47+
| 1.6.10 | 0.2.0 |
48+
| 1.5.31 | 0.1.0 |
49+
50+
</p>
51+
</details>
52+
53+
<details>
54+
<summary>Molecule 1.x Gradle plugin Compose compiler customization instructions</summary>
55+
<p>
56+
57+
Each version of Molecule ships with a specific JetBrains Compose compiler version which works with
58+
a single version of Kotlin (see version table above). Newer versions of the Compose
59+
compiler or alternate Compose compilers can be specified using the Gradle extension.
60+
61+
To use a new version of the JetBrains Compose compiler version:
62+
```kotlin
63+
molecule {
64+
kotlinCompilerPlugin.set("1.4.8")
65+
}
66+
```
67+
68+
To use an alternate Compose compiler dependency:
69+
```kotlin
70+
molecule {
71+
kotlinCompilerPlugin.set("com.example:custom-compose-compiler:1.0.0")
72+
}
73+
```
74+
75+
</p>
76+
</details>
1377

1478

1579
## [1.4.3] - 2024-05-15

README.md

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -163,62 +163,33 @@ For more information see [the `moleculeFlow` documentation](https://cashapp.gith
163163

164164
## Usage
165165

166-
Add the buildscript dependency and apply the plugin to every module which wants to call `launchMolecule` or define `@Composable` functions for use with Molecule.
166+
Molecule is a library for Compose, and it relies on JetBrains' Kotlin Compose plugin to be present for use.
167+
Any module which wants to call `launchMolecule` or define `@Composable` functions for use with Molecule must have this plugin applied.
168+
For more information, see [the JetBrains Compose compiler documentation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compiler.html).
169+
170+
Molecule itself can then be added like any other dependency:
167171

168172
```groovy
169-
buildscript {
170-
repositories {
171-
mavenCentral()
172-
}
173-
dependencies {
174-
classpath 'app.cash.molecule:molecule-gradle-plugin:1.4.3'
175-
}
173+
dependencies {
174+
implementation("app.cash.molecule:molecule-runtime:2.0.0")
176175
}
177-
178-
apply plugin: 'app.cash.molecule'
179176
```
180177

181-
Since Kotlin compiler plugins are an unstable API, certain versions of Molecule only work with
182-
certain versions of Kotlin.
183-
184-
| Kotlin | Molecule |
185-
|--------|----------------|
186-
| 1.9.24 | 1.4.3 |
187-
| 1.9.23 | 1.4.2 |
188-
| 1.9.22 | 1.3.2 - 1.4.1 |
189-
| 1.9.21 | 1.3.1 |
190-
| 1.9.20 | 1.3.0 |
191-
| 1.9.10 | 1.2.1 |
192-
| 1.9.0 | 1.1.0 - 1.2.0 |
193-
| 1.8.22 | 0.11.0 - 1.0.0 |
194-
| 1.8.21 | 0.10.0 |
195-
| 1.8.20 | 0.9.0 |
196-
| 1.8.10 | 0.8.0 |
197-
| 1.8.0 | 0.7.0 - 0.7.1 |
198-
| 1.7.20 | 0.6.0 - 0.6.1 |
199-
| 1.7.10 | 0.4.0 - 0.5.0 |
200-
| 1.7.0 | 0.3.0 - 0.3.1 |
201-
| 1.6.10 | 0.2.0 |
202-
| 1.5.31 | 0.1.0 |
203-
204178
<details>
205179
<summary>Snapshots of the development version are available in Sonatype's snapshots repository.</summary>
206180
<p>
207181

208182
```groovy
209-
buildscript {
210-
repositories {
211-
mavenCentral()
212-
maven {
213-
url 'https://oss.sonatype.org/content/repositories/snapshots/'
214-
}
215-
}
216-
dependencies {
217-
classpath 'app.cash.molecule:molecule-gradle-plugin:1.5.0-SNAPSHOT'
183+
repositories {
184+
mavenCentral()
185+
maven {
186+
url "https://oss.sonatype.org/content/repositories/snapshots/"
218187
}
219188
}
220189
221-
apply plugin: 'app.cash.molecule'
190+
dependencies {
191+
implementation("app.cash.molecule:molecule-runtime:2.1.0-SNAPSHOT")
192+
}
222193
```
223194

224195
</p>
@@ -276,26 +247,6 @@ android {
276247
}
277248
```
278249

279-
### Custom Compose Compiler
280-
281-
Each version of Molecule ships with a specific JetBrains Compose compiler version which works with
282-
a single version of Kotlin (see [version table](#usage) above). Newer versions of the Compose
283-
compiler or alternate Compose compilers can be specified using the Gradle extension.
284-
285-
To use a new version of the JetBrains Compose compiler version:
286-
```kotlin
287-
molecule {
288-
kotlinCompilerPlugin.set("1.4.8")
289-
}
290-
```
291-
292-
To use an alternate Compose compiler dependency:
293-
```kotlin
294-
molecule {
295-
kotlinCompilerPlugin.set("com.example:custom-compose-compiler:1.0.0")
296-
}
297-
```
298-
299250

300251
## License
301252

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ buildscript {
1616
}
1717
}
1818

19-
apply plugin: 'org.jetbrains.dokka'
20-
2119
allprojects {
2220
version = property("VERSION_NAME") as String
2321

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GROUP=app.cash.molecule
22

33
# HEY! If you change the major version here be sure to update release.yaml doc target folder!
4-
VERSION_NAME=1.5.0-SNAPSHOT
4+
VERSION_NAME=2.0.0-SNAPSHOT
55

66
SONATYPE_AUTOMATIC_RELEASE=true
77
SONATYPE_HOST=DEFAULT

0 commit comments

Comments
 (0)