Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gradle configuration instructions for "new memory model" #313

Merged
merged 2 commits into from
Apr 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 53 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,58 @@ cancellation is provided to prevent connection leaks._

Kable can be configured via Gradle Kotlin DSL as follows:

#### Multiplatform
<details open>
<summary>New memory model</summary>

`gradle.properties`

```kotlin
kotlin.native.binary.memoryModel=experimental
```

`build.gradle.kts`

```kotlin
plugins {
id("com.android.application") // or id("com.android.library")
kotlin("multiplatform")
}

repositories {
mavenCentral()
}

kotlin {
android()
js().browser()
macosX64()
iosX64()
iosArm64()

sourceSets {
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutinesVersion}")
implementation("com.juul.kable:core:${kableVersion}")
}
}

val androidMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:${coroutinesVersion}")
}
}
}
}

android {
// ...
}
```
</details>

<details>
<summary>Old memory model</summary>

```kotlin
plugins {
Expand Down Expand Up @@ -520,18 +571,8 @@ android {
_Note that for compatibility with Kable, Native targets (e.g. `macosX64`) require
[Coroutines with multithread support for Kotlin/Native] (more specifically: Coroutines library artifacts that are
suffixed with `-native-mt`)._
</details>

#### Platform-specific

```kotlin
repositories {
mavenCentral()
}

dependencies {
implementation("com.juul.kable:core:$version")
}
```
# License

```
Expand Down