-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Update the tutorial build scripts with 1.9.20 APIs #3824
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
|
@@ -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% | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find a reference to this property anywhere. Could it have been left by accident from an earlier tutorial revision or did I miss something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I guess it's something old. If it's not used in the sample project, we can remove it |
||
``` | ||
|
||
5. Sync the Gradle project. | ||
3. Sync the Gradle project. | ||
|
||
Learn more about adding [dependencies on multiplatform libraries](multiplatform-add-dependencies.md). | ||
|
||
|
@@ -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") | ||
} | ||
// ... | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to specify buildscript dependencies explicitly? I think the explicit version in the plugins block achieves the same goal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, looks better. If it's not used in the sample project, we can remove it