Skip to content

Commit 5f2aeb7

Browse files
committed
[docs] Update readme Install section
1 parent c809b11 commit 5f2aeb7

File tree

2 files changed

+37
-34
lines changed

2 files changed

+37
-34
lines changed

README.md

+37-29
Original file line numberDiff line numberDiff line change
@@ -137,41 +137,57 @@ fun main() = runBlocking {
137137

138138
KStateMachine is available on `Maven Central` and `JitPack` repositories.
139139

140-
The library consists of 2 artifacts:
140+
The library consists of 2 components:
141141

142-
* `kstatemachine` - state machine implementation (depends only on Kotlin Standard library)
143-
* `kstatemachine-coroutines` - add-ons for working with coroutines (depends on Kotlin Coroutines library)
142+
* `kstatemachine` - (mandatory) state machine implementation (depends only on Kotlin Standard library)
143+
* `kstatemachine-coroutines` - (optional) add-ons for working with coroutines (depends on Kotlin Coroutines library)
144144

145145
### Maven Central
146146

147-
Add the dependency:
147+
Add dependencies:
148148

149-
```groovy
150-
// groovy
149+
```kotlin
150+
// kotlin
151151
dependencies {
152-
implementation 'io.github.nsk90:kstatemachine:<Tag>'
153-
implementation 'io.github.nsk90:kstatemachine-coroutines:<Tag>' // optional
152+
// Multiplatform artifacts
153+
implementation("io.github.nsk90:kstatemachine:<Tag>")
154+
implementation("io.github.nsk90:kstatemachine-coroutines:<Tag>")
155+
// or JVM/Android artifacts
156+
implementation("io.github.nsk90:kstatemachine-jvm:<Tag>")
157+
implementation("io.github.nsk90:kstatemachine-coroutines-jvm:<Tag>")
154158
}
155159
```
156160

157-
```kotlin
158-
// kotlin
161+
```groovy
162+
// groovy
159163
dependencies {
160-
implementation("io.github.nsk90:kstatemachine:<Tag>")
161-
implementation("io.github.nsk90:kstatemachine-coroutines:<Tag>") // optional
164+
// multiplatform artifacts
165+
implementation 'io.github.nsk90:kstatemachine:<Tag>'
166+
implementation 'io.github.nsk90:kstatemachine-coroutines:<Tag>' // optional
167+
// etc..
162168
}
163169
```
164170

165171
Where `<Tag>` is a library version.
166172

173+
You can see official docs about [dependencies on multiplatform libraries](https://kotlinlang.org/docs/multiplatform-add-dependencies.html#library-used-in-specific-source-sets)
174+
167175
### JitPack
168176

169-
Currently, JitPack does not support Kotlin multiplatform artifacts.
170-
So versions starting from `0.22.0` are not available there, use mavenCentral instead.
177+
Currently, `JitPack` does not support Kotlin multiplatform artifacts.
178+
So versions starting from `0.22.0` are not available there, use `Maven Central` instead.
171179

172180
Add the [JitPack](https://jitpack.io/#nsk90/kstatemachine/Tag) repository to your build file. Add it in your
173181
root `build.gradle` at the end of repositories:
174182

183+
```kotlin
184+
// kotlin
185+
repositories {
186+
// ...
187+
maven { url = uri("https://jitpack.io") }
188+
}
189+
```
190+
175191
```groovy
176192
// groovy
177193
allprojects {
@@ -182,16 +198,18 @@ allprojects {
182198
}
183199
```
184200

201+
Add dependencies:
202+
185203
```kotlin
186204
// kotlin
187-
repositories {
188-
// ...
189-
maven { url = uri("https://jitpack.io") }
205+
dependencies {
206+
implementation("com.github.nsk90:kstatemachine:<Tag>")
207+
// note that group is different in second artifact, long group name also works for first artifact but not vise versa
208+
// it is some strange JitPack behaviour
209+
implementation("com.github.nsk90.kstatemachine:kstatemachine-coroutines:<Tag>") // optional
190210
}
191211
```
192212

193-
Add the dependency:
194-
195213
```groovy
196214
// groovy
197215
dependencies {
@@ -202,16 +220,6 @@ dependencies {
202220
}
203221
```
204222

205-
```kotlin
206-
// kotlin
207-
dependencies {
208-
implementation("com.github.nsk90:kstatemachine:<Tag>")
209-
// note that group is different in second artifact, long group name also works for first artifact but not vise versa
210-
// it is some strange JitPack behaviour
211-
implementation("com.github.nsk90.kstatemachine:kstatemachine-coroutines:<Tag>") // optional
212-
}
213-
```
214-
215223
Where `<Tag>` is a library version.
216224

217225
## Build

samples/build.gradle.kts

-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ version = rootProject.version
99
kotlin {
1010
jvmToolchain(Versions.jdkVersion)
1111
jvm {}
12-
// js(IR) {
13-
// browser()
14-
// nodejs()
15-
// }
16-
// iosArm64()
1712

1813
sourceSets {
1914
val commonMain by getting {

0 commit comments

Comments
 (0)