@@ -137,41 +137,57 @@ fun main() = runBlocking {
137
137
138
138
KStateMachine is available on ` Maven Central ` and ` JitPack ` repositories.
139
139
140
- The library consists of 2 artifacts :
140
+ The library consists of 2 components :
141
141
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)
144
144
145
145
### Maven Central
146
146
147
- Add the dependency :
147
+ Add dependencies :
148
148
149
- ``` groovy
150
- // groovy
149
+ ``` kotlin
150
+ // kotlin
151
151
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>" )
154
158
}
155
159
```
156
160
157
- ``` kotlin
158
- // kotlin
161
+ ``` groovy
162
+ // groovy
159
163
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..
162
168
}
163
169
```
164
170
165
171
Where ` <Tag> ` is a library version.
166
172
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
+
167
175
### JitPack
168
176
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.
171
179
172
180
Add the [ JitPack] ( https://jitpack.io/#nsk90/kstatemachine/Tag ) repository to your build file. Add it in your
173
181
root ` build.gradle ` at the end of repositories:
174
182
183
+ ``` kotlin
184
+ // kotlin
185
+ repositories {
186
+ // ...
187
+ maven { url = uri(" https://jitpack.io" ) }
188
+ }
189
+ ```
190
+
175
191
``` groovy
176
192
// groovy
177
193
allprojects {
@@ -182,16 +198,18 @@ allprojects {
182
198
}
183
199
```
184
200
201
+ Add dependencies:
202
+
185
203
``` kotlin
186
204
// 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
190
210
}
191
211
```
192
212
193
- Add the dependency:
194
-
195
213
``` groovy
196
214
// groovy
197
215
dependencies {
@@ -202,16 +220,6 @@ dependencies {
202
220
}
203
221
```
204
222
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
-
215
223
Where ` <Tag> ` is a library version.
216
224
217
225
## Build
0 commit comments