Skip to content

Commit 9fbc6de

Browse files
committed
[docs] Move intallation details into documantation to free up README
1 parent 93e39e9 commit 9fbc6de

File tree

2 files changed

+120
-99
lines changed

2 files changed

+120
-99
lines changed

README.md

+17-98
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
[![Share on Reddit](https://img.shields.io/badge/reddit-share-red?logo=reddit&style=flat)](https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fnsk90%2Fkstatemachine&title=I%20like%20KStateMachine%20library)
1717

1818

19-
[Documentation](https://kstatemachine.github.io/kstatemachine) | [Quick start](#quick-start-sample) | [Samples](#samples) | [Install](#install) | [License](#license) | [Discussions](https://github.com/nsk90/kstatemachine/discussions)
19+
[Documentation](https://kstatemachine.github.io/kstatemachine) | [Quick start](#quick-start-sample) | [Samples](#samples) | [Install](#install) | [Sponsors](#sponsors-) | [License](#license) | [Discussions](https://github.com/nsk90/kstatemachine/discussions)
2020

2121
KStateMachine is a Kotlin DSL library for creating [state machines](https://en.wikipedia.org/wiki/Finite-state_machine)
2222
and [statecharts](https://www.sciencedirect.com/science/article/pii/0167642387900359/pdf).
@@ -64,13 +64,6 @@ State management features:
6464
> [!IMPORTANT]
6565
> SEE FULL [DOCUMENTATION HERE](https://kstatemachine.github.io/kstatemachine)
6666
67-
> [!NOTE]
68-
> The library is in a development phase. You are welcome to propose useful features, or contribute to the project.
69-
>
70-
> Don't forget to push the ⭐ if you like this project.
71-
>
72-
> You can donate or become a sponsor to support the project, using ❤️ github-sponsors button.
73-
7467
## Quick start sample
7568

7669
### Finishing traffic light
@@ -157,114 +150,40 @@ fun main() = runBlocking {
157150

158151
KStateMachine is available on `Maven Central` and `JitPack` repositories.
159152

160-
The library consists of 2 components:
161-
162-
* `kstatemachine` - (mandatory) state machine implementation (depends only on Kotlin Standard library)
163-
* `kstatemachine-coroutines` - (optional) add-ons for working with coroutines (depends on Kotlin Coroutines library)
164-
165-
Please note that starting from `v0.22.0` the library switched to Kotlin Multiplatform and artifact naming has changed.
153+
See [install section in the docs](https://kstatemachine.github.io/kstatemachine/#install) for details.
166154

167155
### Maven Central
168156

169-
Add dependencies:
170-
171157
```kotlin
172-
// kotlin
173158
dependencies {
174-
// multiplatform artifacts (starting from 0.22.0)
159+
// multiplatform artifacts, where <Tag> is a library version.
175160
implementation("io.github.nsk90:kstatemachine:<Tag>")
176161
implementation("io.github.nsk90:kstatemachine-coroutines:<Tag>")
177-
// or JVM/Android artifacts (starting from 0.22.0)
178-
implementation("io.github.nsk90:kstatemachine-jvm:<Tag>")
179-
implementation("io.github.nsk90:kstatemachine-coroutines-jvm:<Tag>")
180-
// or iOS artifacts (starting from 0.22.1)
181-
implementation("io.github.nsk90:kstatemachine-iosarm64:<Tag>")
182-
implementation("io.github.nsk90:kstatemachine-coroutines-iosarm64:<Tag>")
183-
184-
implementation("io.github.nsk90:kstatemachine-iosx64:<Tag>")
185-
implementation("io.github.nsk90:kstatemachine-coroutines-iosx64:<Tag>")
186-
187-
implementation("io.github.nsk90:kstatemachine-iossimulatorarm64:<Tag>")
188-
implementation("io.github.nsk90:kstatemachine-coroutines-iossimulatorarm64:<Tag>")
189162
}
190163
```
191164

192-
```groovy
193-
// groovy
194-
dependencies {
195-
// multiplatform artifacts
196-
implementation 'io.github.nsk90:kstatemachine:<Tag>'
197-
implementation 'io.github.nsk90:kstatemachine-coroutines:<Tag>' // optional
198-
// etc..
199-
}
200-
```
201-
202-
Where `<Tag>` is a library version.
203-
204-
You can see official docs
205-
about [dependencies on multiplatform libraries](https://kotlinlang.org/docs/multiplatform-add-dependencies.html#library-used-in-specific-source-sets)
206-
207-
### JitPack (deprecated)
208-
209-
Currently, `JitPack` does not support Kotlin multiplatform artifacts.
210-
So versions starting from `0.22.0` are not available there, use `Maven Central` instead.
211-
212-
Add the [JitPack](https://jitpack.io/#nsk90/kstatemachine/Tag) repository to your build file. Add it in your
213-
root `build.gradle` at the end of repositories:
214-
215-
```kotlin
216-
// kotlin
217-
repositories {
218-
// ...
219-
maven { url = uri("https://jitpack.io") }
220-
}
221-
```
165+
## Build
222166

223-
```groovy
224-
// groovy
225-
allprojects {
226-
repositories {
227-
// ...
228-
maven { url 'https://jitpack.io' }
229-
}
230-
}
231-
```
167+
Run `./gradlew build` or build with `Intellij IDEA`.
232168

233-
Add dependencies:
169+
## Contribution
234170

235-
```kotlin
236-
// kotlin
237-
dependencies {
238-
implementation("com.github.nsk90:kstatemachine:<Tag>")
239-
// note that group is different in second artifact, long group name also works for first artifact but not vise versa
240-
// it is some strange JitPack behaviour
241-
implementation("com.github.nsk90.kstatemachine:kstatemachine-coroutines:<Tag>") // optional
242-
}
243-
```
171+
The library is in a active development phase. You are welcome to propose useful features and contribute to the project.
172+
See [CONTRIBUTING](./CONTRIBUTING.md) file.
244173

245-
```groovy
246-
// groovy
247-
dependencies {
248-
implementation 'com.github.nsk90:kstatemachine:<Tag>'
249-
// note that group is different in second artifact, long group name also works for first artifact but not vise versa
250-
// it is some strange JitPack behaviour
251-
implementation 'com.github.nsk90.kstatemachine:kstatemachine-coroutines:<Tag>' // optional
252-
}
253-
```
174+
## Sponsors ❤
254175

255-
Where `<Tag>` is a library version.
176+
> [!NOTE]
177+
> Please, push the ⭐ if you like this project
256178
257-
## Build
179+
I highly appreciate that you donate or become a sponsor to support the project.
180+
Use ❤️ github-sponsors button to see supported methods.
258181

259-
Run `./gradlew build` or build with `Intellij IDEA`.
182+
## Thanks to supporters
260183

261-
To run tests from IDE download official [Kotest plugin](https://github.com/kotest/kotest-intellij-plugin).
184+
[![Stargazers repo roster for @nsk90/kstatemachine](https://reporoster.com/stars/dark/nsk90/kstatemachine)](https://github.com/nsk90/kstatemachine/stargazers)
185+
[![Forkers repo roster for @nsk90/kstatemachine](https://reporoster.com/forks/dark/nsk90/kstatemachine)](https://github.com/nsk90/kstatemachine/network/members)
262186

263187
## License
264188

265-
Licensed under permissive [Boost Software License](./LICENSE)
266-
267-
## Thanks to supporters
268-
269-
[![Stargazers repo roster for @nsk90/kstatemachine](https://reporoster.com/stars/dark/nsk90/kstatemachine)](https://github.com/nsk90/kstatemachine/stargazers)
270-
[![Forkers repo roster for @nsk90/kstatemachine](https://reporoster.com/forks/dark/nsk90/kstatemachine)](https://github.com/nsk90/kstatemachine/network/members)
189+
Licensed under permissive [Boost Software License](./LICENSE)

docs/index.md

+103-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
* [Object states](#object-states)
5959
* [Do not](#do-not)
6060
* [Known issues](#known-issues)
61+
* [Install](#install)
6162

6263
## Overview
6364

@@ -1104,4 +1105,105 @@ instance of
11041105
a class, such check may be positive for class parameterized with any type.
11051106
So it's easier avoid using generic types in such cases. You have to use custom `EventMatcher`s and `DataExtractor`'s
11061107
that
1107-
will use some additional information to compare such types, or be sure that such invalid comparison never happens.
1108+
will use some additional information to compare such types, or be sure that such invalid comparison never happens.
1109+
1110+
## Install
1111+
1112+
KStateMachine is available on `Maven Central` and `JitPack` repositories.
1113+
1114+
The library consists of 2 components:
1115+
1116+
* `kstatemachine` - (mandatory) state machine implementation (depends only on Kotlin Standard library)
1117+
* `kstatemachine-coroutines` - (optional) add-ons for working with coroutines (depends on Kotlin Coroutines library)
1118+
1119+
Please note that starting from `v0.22.0` the library switched to Kotlin Multiplatform and artifact naming has changed.
1120+
1121+
### Maven Central
1122+
1123+
Add dependencies:
1124+
1125+
```kotlin
1126+
// kotlin
1127+
dependencies {
1128+
// multiplatform artifacts (starting from 0.22.0)
1129+
implementation("io.github.nsk90:kstatemachine:<Tag>")
1130+
implementation("io.github.nsk90:kstatemachine-coroutines:<Tag>")
1131+
// or JVM/Android artifacts (starting from 0.22.0)
1132+
implementation("io.github.nsk90:kstatemachine-jvm:<Tag>")
1133+
implementation("io.github.nsk90:kstatemachine-coroutines-jvm:<Tag>")
1134+
// or iOS artifacts (starting from 0.22.1)
1135+
implementation("io.github.nsk90:kstatemachine-iosarm64:<Tag>")
1136+
implementation("io.github.nsk90:kstatemachine-coroutines-iosarm64:<Tag>")
1137+
1138+
implementation("io.github.nsk90:kstatemachine-iosx64:<Tag>")
1139+
implementation("io.github.nsk90:kstatemachine-coroutines-iosx64:<Tag>")
1140+
1141+
implementation("io.github.nsk90:kstatemachine-iossimulatorarm64:<Tag>")
1142+
implementation("io.github.nsk90:kstatemachine-coroutines-iossimulatorarm64:<Tag>")
1143+
}
1144+
```
1145+
1146+
```groovy
1147+
// groovy
1148+
dependencies {
1149+
// multiplatform artifacts
1150+
implementation 'io.github.nsk90:kstatemachine:<Tag>'
1151+
implementation 'io.github.nsk90:kstatemachine-coroutines:<Tag>' // optional
1152+
// etc..
1153+
}
1154+
```
1155+
1156+
Where `<Tag>` is a library version.
1157+
1158+
You can see official docs
1159+
about [dependencies on multiplatform libraries](https://kotlinlang.org/docs/multiplatform-add-dependencies.html#library-used-in-specific-source-sets)
1160+
1161+
### JitPack (deprecated)
1162+
1163+
Currently, `JitPack` does not support Kotlin multiplatform artifacts.
1164+
So versions starting from `0.22.0` are not available there, use `Maven Central` instead.
1165+
1166+
Add the [JitPack](https://jitpack.io/#nsk90/kstatemachine/Tag) repository to your build file. Add it in your
1167+
root `build.gradle` at the end of repositories:
1168+
1169+
```kotlin
1170+
// kotlin
1171+
repositories {
1172+
// ...
1173+
maven { url = uri("https://jitpack.io") }
1174+
}
1175+
```
1176+
1177+
```groovy
1178+
// groovy
1179+
allprojects {
1180+
repositories {
1181+
// ...
1182+
maven { url 'https://jitpack.io' }
1183+
}
1184+
}
1185+
```
1186+
1187+
Add dependencies:
1188+
1189+
```kotlin
1190+
// kotlin
1191+
dependencies {
1192+
implementation("com.github.nsk90:kstatemachine:<Tag>")
1193+
// note that group is different in second artifact, long group name also works for first artifact but not vise versa
1194+
// it is some strange JitPack behaviour
1195+
implementation("com.github.nsk90.kstatemachine:kstatemachine-coroutines:<Tag>") // optional
1196+
}
1197+
```
1198+
1199+
```groovy
1200+
// groovy
1201+
dependencies {
1202+
implementation 'com.github.nsk90:kstatemachine:<Tag>'
1203+
// note that group is different in second artifact, long group name also works for first artifact but not vise versa
1204+
// it is some strange JitPack behaviour
1205+
implementation 'com.github.nsk90.kstatemachine:kstatemachine-coroutines:<Tag>' // optional
1206+
}
1207+
```
1208+
1209+
Where `<Tag>` is a library version.

0 commit comments

Comments
 (0)