PeopleInSpace/common/build.gradle.kts

135 lines
3.5 KiB
Text
Raw Normal View History

2020-09-12 15:41:51 +00:00
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
id("kotlinx-serialization")
id("com.android.library")
id("org.jetbrains.kotlin.native.cocoapods")
id("com.squareup.sqldelight")
}
2020-09-12 15:41:51 +00:00
// CocoaPods requires the podspec to have a version.
version = "1.0"
android {
2020-10-18 15:49:26 +00:00
compileSdkVersion(AndroidSdk.compile)
2020-09-12 15:41:51 +00:00
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
2020-10-18 15:49:26 +00:00
minSdkVersion(AndroidSdk.min)
targetSdkVersion(AndroidSdk.target)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}
kotlin {
2020-09-12 15:41:51 +00:00
val sdkName: String? = System.getenv("SDK_NAME")
2020-09-12 15:41:51 +00:00
val isiOSDevice = sdkName.orEmpty().startsWith("iphoneos")
if (isiOSDevice) {
iosArm64("iOS")
} else {
iosX64("iOS")
}
2020-09-12 15:41:51 +00:00
val isWatchOSDevice = sdkName.orEmpty().startsWith("watchos")
if (isWatchOSDevice) {
watchosArm64("watch")
} else {
watchosX86("watch")
}
macosX64("macOS")
android()
jvm()
cocoapods {
// Configure fields required by CocoaPods.
summary = "Some description for a Kotlin/Native module"
homepage = "Link to a Kotlin/Native module homepage"
}
2020-04-26 18:25:59 +00:00
js {
browser {
}
}
sourceSets {
2020-10-28 21:19:44 +00:00
2020-10-18 15:49:26 +00:00
sourceSets["commonMain"].dependencies {
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}") {
isForce = true
}
2020-10-18 15:49:26 +00:00
// Ktor
implementation(Ktor.clientCore)
implementation(Ktor.clientJson)
implementation(Ktor.clientLogging)
implementation(Ktor.clientSerialization)
// Kotlinx Serialization
implementation(Serialization.core)
// SQL Delight
implementation(SqlDelight.runtime)
implementation(SqlDelight.coroutineExtensions)
// koin
api(Koin.core)
// kermit
api(Deps.kermit)
2020-10-18 15:49:26 +00:00
}
sourceSets["commonTest"].dependencies {
}
2020-10-18 15:49:26 +00:00
sourceSets["androidMain"].dependencies {
implementation(Ktor.clientAndroid)
implementation(SqlDelight.androidDriver)
}
2020-10-18 15:49:26 +00:00
sourceSets["androidTest"].dependencies {
implementation(kotlin("test-junit"))
implementation(Test.junit)
2020-09-12 16:51:28 +00:00
}
2020-10-18 15:49:26 +00:00
sourceSets["jvmMain"].dependencies {
implementation(Ktor.clientApache)
implementation(Ktor.slf4j)
implementation(SqlDelight.jdbcDriver)
implementation(SqlDelight.sqlliteDriver)
}
2020-10-18 15:49:26 +00:00
sourceSets["iOSMain"].dependencies {
implementation(Ktor.clientIos)
implementation(SqlDelight.nativeDriver)
}
sourceSets["iOSTest"].dependencies {
}
2020-10-18 15:49:26 +00:00
sourceSets["watchMain"].dependencies {
implementation(Ktor.clientIos)
implementation(SqlDelight.nativeDriver)
}
2020-10-18 15:49:26 +00:00
sourceSets["macOSMain"].dependencies {
implementation(Ktor.clientCio)
implementation(SqlDelight.nativeDriverMacos)
}
2020-04-26 18:25:59 +00:00
2020-10-18 15:49:26 +00:00
sourceSets["jsMain"].dependencies {
implementation(Ktor.clientJs)
2020-04-26 18:25:59 +00:00
}
}
}
sqldelight {
database("PeopleInSpaceDatabase") {
packageName = "com.surrus.peopleinspace.db"
sourceFolders = listOf("sqldelight")
}
2020-04-26 18:25:59 +00:00
}