Files
coco 723ce1af5c a
2026-07-03 15:12:48 +08:00

124 lines
3.3 KiB
Kotlin

/*
* The MIT License (MIT)
*
* Copyright (c) 2020-2022 Dmitriy Gorbunov (dmitriy.goto@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
`publish-library`
}
kotlin {
ios()
iosSimulatorArm64()
jvm()
js(IR) {
browser()
}
android {
publishLibraryVariants("release", "debug")
}
sourceSets {
all {
languageSettings.optIn("kotlin.RequiresOptIn")
}
val commonMain by getting {
dependencies {
api(Libs.coroutinesCore)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(Libs.kotlinxSerializationJson)
}
}
val jvmMain by getting {
dependsOn(commonMain)
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
}
}
val jvmTest by getting {
dependsOn(commonTest)
}
val jsMain by getting {
dependsOn(commonMain)
}
val jsTest by getting {
dependsOn(commonTest)
dependencies {
implementation(kotlin("test-js"))
}
}
val androidMain by getting {
dependsOn(jvmMain)
dependencies {
compileOnly(Libs.androidxAppcompat)
}
}
// Fix test run: https://youtrack.jetbrains.com/issue/KT-40571
val androidTest by getting {
dependsOn(jvmTest)
}
val iosMain by getting {
dependsOn(commonMain)
}
val iosTest by getting {
dependsOn(commonTest)
}
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}
}
}
android {
compileSdk = AndroidSdk.compile
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = AndroidSdk.min
targetSdk = AndroidSdk.target
}
}