Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

Update 03_Adding_dependecies.md #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ We will use the following multiplatform libraries in our project:
* `kotlinx.serialization` – to deserialize JSON responses into objects of entity classes.
* `SQLDelight` – this will generate Kotlin code from SQL queries to create a type-safe database API.

To add a multiplatform library to the KMM module, we need to add dependency instructions (in our case, implementation) to the dependencies block of the relevant source sets in the 'build.gradle.kts' file in the **KMM module's directory**. You can read more about adding dependencies in the [documentation](https://kotlinlang.org/docs/mobile/add-dependencies.html#multiplatform-libraries).
To add a multiplatform library to the KMM module, we need to add dependency instructions (in our case, implementation) to the dependencies block of the relevant source sets in the 'build.gradle.kts' file in the **KMM shared directory**. You can read more about adding dependencies in the [documentation](https://kotlinlang.org/docs/mobile/add-dependencies.html#multiplatform-libraries).

### Adding kotlinx.coroutines

We need to specify a dependency on `kotlinx.coroutines` in the common source set in order to add them to our project. We will do this by adding the following line to the `build.gradle.kts` file in the KMM module directory:
We need to specify a dependency on `kotlinx.coroutines` in the common source set in order to add them to our project. We will do this by adding the following line to the `build.gradle.kts` file in the KMM shared directory:

```kotlin
val coroutinesVersion = "1.3.9-native-mt"
Expand Down Expand Up @@ -47,7 +47,7 @@ buildscript {
}
```

Add this line to the plugins block at the very beginning of the `build.gradle` file in the **KMM module directory**:
Add this line to the plugins block at the very beginning of the `build.gradle` file in the **KMM shared directory**:

```kotlin
plugins {
Expand Down Expand Up @@ -128,7 +128,7 @@ buildscript {

```

Add this line to the plugins block at the very beginning of the `build.gradle` file in the KMM module directory:
Add this line to the plugins block at the very beginning of the `build.gradle` file in the KMM shared directory:

```kotlin
plugins {
Expand Down