2023-03-23 19:44:18 +08:00
|
|
|
plugins {
|
|
|
|
kotlin("multiplatform")
|
|
|
|
id("com.android.library")
|
|
|
|
id("org.jetbrains.compose")
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
2023-07-27 20:09:17 +08:00
|
|
|
androidTarget()
|
2023-03-23 19:44:18 +08:00
|
|
|
|
2023-07-13 01:58:36 +08:00
|
|
|
listOf(
|
|
|
|
iosX64(),
|
|
|
|
iosArm64(),
|
|
|
|
iosSimulatorArm64()
|
|
|
|
).forEach { iosTarget ->
|
|
|
|
iosTarget.binaries.framework {
|
2023-03-23 19:44:18 +08:00
|
|
|
baseName = "shared"
|
|
|
|
isStatic = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
val commonMain by getting {
|
|
|
|
dependencies {
|
|
|
|
implementation(compose.runtime)
|
|
|
|
implementation(compose.foundation)
|
|
|
|
implementation(compose.material)
|
|
|
|
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
|
|
|
|
implementation(compose.components.resources)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val androidMain by getting {
|
|
|
|
dependencies {
|
|
|
|
api("androidx.activity:activity-compose:1.6.1")
|
|
|
|
api("androidx.appcompat:appcompat:1.6.1")
|
|
|
|
api("androidx.core:core-ktx:1.9.0")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val iosX64Main by getting
|
|
|
|
val iosArm64Main by getting
|
|
|
|
val iosSimulatorArm64Main by getting
|
|
|
|
val iosMain by creating {
|
|
|
|
dependsOn(commonMain)
|
|
|
|
iosX64Main.dependsOn(this)
|
|
|
|
iosArm64Main.dependsOn(this)
|
|
|
|
iosSimulatorArm64Main.dependsOn(this)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdk = (findProperty("android.compileSdk") as String).toInt()
|
|
|
|
namespace = "com.myapplication.common"
|
|
|
|
|
|
|
|
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
|
|
|
sourceSets["main"].res.srcDirs("src/androidMain/res")
|
|
|
|
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk = (findProperty("android.minSdk") as String).toInt()
|
|
|
|
targetSdk = (findProperty("android.targetSdk") as String).toInt()
|
|
|
|
}
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
|
|
}
|
|
|
|
kotlin {
|
|
|
|
jvmToolchain(11)
|
|
|
|
}
|
|
|
|
}
|