You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.6 KiB
80 lines
2.6 KiB
/*
|
|
* Copyright 2024 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
plugins {
|
|
alias(libs.plugins.nowinandroid.kmp.library)
|
|
alias(libs.plugins.nowinandroid.di.koin)
|
|
alias(libs.plugins.sqldelight.gradle.plugin)
|
|
}
|
|
|
|
android {
|
|
namespace = "com.google.samples.apps.nowinandroid.core.database"
|
|
}
|
|
|
|
kotlin {
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
api(projects.core.model)
|
|
implementation(projects.core.common)
|
|
implementation(libs.kotlinx.datetime)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.sqldelight.coroutines.extensions)
|
|
implementation(libs.sqldelight.primitive.adapters)
|
|
}
|
|
androidMain.dependencies {
|
|
implementation(libs.koin.android)
|
|
implementation(libs.sqldelight.android.driver)
|
|
}
|
|
androidUnitTest.dependencies {
|
|
implementation(libs.sqldelight.sqlite.driver)
|
|
}
|
|
nativeMain.dependencies {
|
|
implementation(libs.sqldelight.native.driver)
|
|
}
|
|
jvmMain.dependencies {
|
|
implementation(libs.sqldelight.sqlite.driver)
|
|
}
|
|
// https://github.com/cashapp/sqldelight/pull/4965/files
|
|
// wasmJsMain.dependencies {
|
|
// implementation(libs.sqldelight.webworker.driver)
|
|
// implementation(npm("@cashapp/sqldelight-sqljs-worker", "2.0.1"))
|
|
// implementation(npm("sql.js", "1.8.0"))
|
|
// implementation(devNpm("copy-webpack-plugin", "9.1.0"))
|
|
// }
|
|
}
|
|
}
|
|
|
|
sqldelight {
|
|
databases {
|
|
create("NiaDatabase") {
|
|
packageName.set("com.google.samples.apps.nowinandroid.core.database")
|
|
generateAsync.set(true)
|
|
dialect("app.cash.sqldelight:sqlite-3-38-dialect:2.0.2")
|
|
}
|
|
}
|
|
}
|
|
|
|
// Workaround yarn concurrency issue - https://youtrack.jetbrains.com/issue/KT-43320
|
|
tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>()
|
|
.configureEach {
|
|
args.addAll(
|
|
listOf(
|
|
"--mutex",
|
|
"file:${file("../build/.yarn-mutex")}",
|
|
),
|
|
)
|
|
}
|