Skip to content

Commit bf47bef

Browse files
authored
Updated README w/ information about modules and KMP builds (#161)
* Updated README w/ information about modules and KMP builds - included information about modules - added badge for KDoc - described how to add the dependency to KMP project - explicitly specify the language for code snippets
1 parent 307d737 commit bf47bef

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
[![Kotlin Alpha](https://kotl.in/badges/alpha.svg)](https://kotlinlang.org/docs/components-stability.html)
44
[![JetBrains incubator project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
55
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
6+
[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-io-core/0.2.0)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-io-core/0.2.0)
67
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
78
[![TeamCity build](https://img.shields.io/teamcity/build/s/KotlinTools_KotlinxIo_BuildAggregated.svg?server=http%3A%2F%2Fteamcity.jetbrains.com)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=KotlinTools_KotlinxIo_BuildAggregated&guest=1)
9+
[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://fzhinkin.github.io/kotlinx-io-dokka-docs-preview/)
810

911
A multiplatform Kotlin library providing basic IO primitives. `kotlinx-io` is based on [Okio](https://github.com/square/okio) but does not preserve backward compatibility with it.
1012

@@ -17,23 +19,42 @@ The library is built around `Buffer` - a mutable sequence of bytes. `Buffer` wor
1719

1820
The library also provides interfaces representing data sources and destinations - `Source` and `Sink`.
1921

22+
In addition to `Buffer`, the library provides an immutable sequence of bytes - `ByteString`.
23+
24+
There are two `kotlinx-io` modules:
25+
- [kotlinx-io-bytestring](./bytestring) - provides `ByteString`.
26+
- [kotlinx-io-core](./core) - provides IO primitives (`Buffer`, `Source`, `Sink`), depends on `kotlinx-io-bytestring`.
27+
2028
## Using in your projects
2129

2230
> Note that the library is experimental, and the API is subject to change.
2331
2432
### Gradle
2533

2634
Make sure that you have `mavenCentral()` in the list of repositories:
27-
```
35+
```kotlin
2836
repositories {
2937
mavenCentral()
3038
}
3139
```
3240

3341
Add the library to dependencies:
34-
```
42+
```kotlin
3543
dependencies {
36-
implementation("org.jetbrains.kotlinx:kotlinx-io:0.2.0-alpha-dev1")
44+
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.2.0")
45+
}
46+
```
47+
48+
In multiplatform projects, add a dependency to the `commonMain` source set dependencies:
49+
```kotlin
50+
kotlin {
51+
sourceSets {
52+
commonMain {
53+
dependencies {
54+
implementation("org.jetbrains.kotlinx:kotlinx-io:0.2.0")
55+
}
56+
}
57+
}
3758
}
3859
```
3960

@@ -43,8 +64,8 @@ Add the library to dependencies:
4364
```xml
4465
<dependency>
4566
<groupId>org.jetbrains.kotlinx</groupId>
46-
<artifactId>kotlinx-io</artifactId>
47-
<version>0.2.0-alpha-dev1</version>
67+
<artifactId>kotlinx-io-core</artifactId>
68+
<version>0.2.0</version>
4869
</dependency>
4970
```
5071

0 commit comments

Comments
 (0)