Skip to content

Commit

Permalink
Update the tutorial build scripts with 1.9.20 APIs (#3824)
Browse files Browse the repository at this point in the history
Co-authored-by: Timofey Solonin <[email protected]>
  • Loading branch information
abdulowork and timofey-solonin authored Oct 20, 2023
1 parent 1866119 commit 1cf4b5d
Showing 1 changed file with 9 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,23 @@ Both the `kotlinx.serialization` and SQLDelight libraries also require additiona
val dateTimeVersion = "%dateTimeVersion%"

sourceSets {
targetHierarchy.default()

val commonMain by getting {
commonMain {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("com.squareup.sqldelight:runtime:$sqlDelightVersion")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:$dateTimeVersion")
}
}
val androidMain by getting {
}
androidMain {
dependencies {
implementation("io.ktor:ktor-client-android:$ktorVersion")
implementation("com.squareup.sqldelight:android-driver:$sqlDelightVersion")
}
}
val iosMain by getting {
iosMain {
// ...
dependencies {
implementation("io.ktor:ktor-client-darwin:$ktorVersion")
Expand All @@ -117,32 +115,12 @@ Both the `kotlinx.serialization` and SQLDelight libraries also require additiona
```kotlin
plugins {
// ...
kotlin("plugin.serialization") version "%kotlinVersion%"
id("com.squareup.sqldelight")
kotlin("plugin.serialization").version("%kotlinVersion%")
id("com.squareup.sqldelight").version("%sqlDelightVersion%")
}
```

3. Now go to the `build.gradle.kts` file in the project _root directory_ and specify the classpath for the plugin in the
build system dependencies:

```kotlin
buildscript {

dependencies {
// ...
classpath("com.squareup.sqldelight:gradle-plugin:%sqlDelightVersion%")
}
}
```

4. Finally, define the SQLDelight version in the `gradle.properties` file in the project _root directory_ to ensure that
the SQLDelight versions of the plugin and the libraries are the same:

```none
sqlDelightVersion=%sqlDelightVersion%
```

5. Sync the Gradle project.
3. Sync the Gradle project.

Learn more about adding [dependencies on multiplatform libraries](multiplatform-add-dependencies.md).

Expand Down Expand Up @@ -574,8 +552,8 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.cardview:cardview:1.0.0")
}
// ...
```
Expand Down

0 comments on commit 1cf4b5d

Please sign in to comment.