Skip to content

Commit

Permalink
Add Gradle configuration instructions for "new memory model" (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Apr 11, 2022
1 parent ae8f351 commit d249772
Showing 1 changed file with 53 additions and 12 deletions.
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

0 comments on commit d249772

Please sign in to comment.