-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(deps): update android datastore dependencies for platform support #161
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
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 |
|---|---|---|
|
|
@@ -19,12 +19,24 @@ kotlin { | |
| commonMain.dependencies { | ||
| api(project(":generic-datastore-core")) | ||
| implementation(libs.coroutines.core) | ||
| api(libs.datastore.core) | ||
| compileOnly(libs.datastore.core) | ||
| api(libs.datastore.core.okio) | ||
| api(libs.okio) | ||
| implementation(libs.kotlinx.io.core) | ||
| implementation(libs.kotlinx.serialization.json) | ||
| } | ||
|
|
||
| androidMain.dependencies { | ||
| api(libs.datastore.android.core) | ||
| } | ||
|
|
||
| jvmMain.dependencies { | ||
| api(libs.datastore.core) | ||
| } | ||
|
|
||
| iosMain.dependencies { | ||
| api(libs.datastore.core) | ||
| } | ||
|
Comment on lines
+22
to
+39
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. Similarly, using Keeping api(libs.datastore.core)
api(libs.datastore.core.okio)
api(libs.okio)
implementation(libs.kotlinx.io.core)
implementation(libs.kotlinx.serialization.json)
}
androidMain.dependencies {
api(libs.datastore.android.core)
} |
||
| } | ||
| } | ||
|
|
||
|
|
||
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.
Using
compileOnlyincommonMainfordatastore.preferences.coreis unnecessary and requires duplicating the dependency asapiinjvmMain,iosMain, and potentially other targets.Instead, you can keep
api(libs.datastore.preferences.core)incommonMain. Gradle's dependency resolution will automatically handle the dependency on Android whenandroidMaindeclaresapi(libs.datastore.preferences)(sincedatastore-preferencestransitively depends ondatastore-preferences-core). This avoids duplicating the dependency for every other target platform and ensures that any future targets added to the project will automatically inherit the core dependency.api(libs.datastore.preferences.core) api(libs.okio) implementation(libs.kotlinx.io.core) implementation(libs.kotlinx.serialization.json) } androidMain.dependencies { api(libs.datastore.preferences) }