116 lines
3.3 KiB
Kotlin
116 lines
3.3 KiB
Kotlin
@file:Suppress("UnstableApiUsage")
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
plugins {
|
|
kotlin("multiplatform")
|
|
kotlin("native.cocoapods")
|
|
kotlin("plugin.serialization")
|
|
id("com.android.library")
|
|
id("app.cash.sqldelight")
|
|
id("co.touchlab.skie")
|
|
}
|
|
|
|
android {
|
|
namespace = "co.touchlab.kampkit"
|
|
compileSdk = libs.versions.compileSdk.get().toInt()
|
|
defaultConfig {
|
|
minSdk = libs.versions.minSdk.get().toInt()
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
testOptions {
|
|
unitTests {
|
|
isIncludeAndroidResources = true
|
|
}
|
|
}
|
|
|
|
lint {
|
|
warningsAsErrors = true
|
|
abortOnError = true
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
|
|
tasks.withType<KotlinCompile> {
|
|
kotlinOptions.jvmTarget = "1.8"
|
|
}
|
|
|
|
version = "1.2"
|
|
|
|
kotlin {
|
|
@Suppress("OPT_IN_USAGE")
|
|
targetHierarchy.default()
|
|
androidTarget()
|
|
ios()
|
|
// Note: iosSimulatorArm64 target requires that all dependencies have M1 support
|
|
iosSimulatorArm64()
|
|
|
|
sourceSets {
|
|
all {
|
|
languageSettings.apply {
|
|
optIn("kotlin.RequiresOptIn")
|
|
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
|
|
optIn("kotlin.time.ExperimentalTime")
|
|
}
|
|
}
|
|
|
|
val commonMain by getting {
|
|
dependencies {
|
|
implementation(libs.koin.core)
|
|
implementation(libs.coroutines.core)
|
|
implementation(libs.sqlDelight.coroutinesExt)
|
|
implementation(libs.bundles.ktor.common)
|
|
implementation(libs.multiplatformSettings.common)
|
|
implementation(libs.kotlinx.dateTime)
|
|
implementation(libs.touchlab.skie.annotations)
|
|
api(libs.touchlab.kermit)
|
|
}
|
|
}
|
|
val commonTest by getting {
|
|
dependencies {
|
|
implementation(libs.bundles.shared.commonTest)
|
|
}
|
|
}
|
|
val androidMain by getting {
|
|
dependencies {
|
|
implementation(libs.androidx.lifecycle.viewmodel)
|
|
implementation(libs.sqlDelight.android)
|
|
implementation(libs.ktor.client.okHttp)
|
|
}
|
|
}
|
|
val androidUnitTest by getting {
|
|
dependencies {
|
|
implementation(libs.bundles.shared.androidTest)
|
|
}
|
|
}
|
|
val iosMain by getting {
|
|
dependencies {
|
|
implementation(libs.sqlDelight.native)
|
|
implementation(libs.ktor.client.ios)
|
|
api(libs.touchlab.kermit.simple)
|
|
}
|
|
}
|
|
}
|
|
|
|
cocoapods {
|
|
summary = "Common library for the KaMP starter kit"
|
|
homepage = "https://github.com/touchlab/KaMPKit"
|
|
framework {
|
|
isStatic = false // SwiftUI preview requires dynamic framework
|
|
linkerOpts("-lsqlite3")
|
|
export(libs.touchlab.kermit.simple)
|
|
}
|
|
extraSpecAttributes["swift_version"] = "\"5.0\"" // <- SKIE Needs this!
|
|
podfile = project.file("../ios/Podfile")
|
|
}
|
|
}
|
|
|
|
sqldelight {
|
|
databases.create("KaMPKitDb") {
|
|
packageName.set("co.touchlab.kampkit.db")
|
|
}
|
|
}
|