2020-07-02 12:19:29 +02:00
|
|
|
plugins {
|
|
|
|
kotlin("multiplatform")
|
2021-10-25 14:27:02 +02:00
|
|
|
if (System.getProperty("includeAndroid")?.toBoolean() == true) {
|
|
|
|
id("com.android.library")
|
|
|
|
}
|
2020-07-02 12:19:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
explicitApi()
|
|
|
|
|
2021-10-25 14:27:02 +02:00
|
|
|
val includeAndroid = System.getProperty("includeAndroid")?.toBoolean() ?: true
|
|
|
|
|
2020-07-02 12:19:29 +02:00
|
|
|
val commonMain by sourceSets.getting {
|
|
|
|
dependencies {
|
|
|
|
implementation(rootProject)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val commonTest by sourceSets.getting {
|
|
|
|
dependencies {
|
2021-10-26 17:16:36 +02:00
|
|
|
implementation(kotlin("test-common"))
|
2020-07-02 12:19:29 +02:00
|
|
|
implementation(kotlin("test-annotations-common"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jvm {
|
|
|
|
compilations.all {
|
|
|
|
kotlinOptions.jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
compilations["main"].dependencies {
|
2020-07-09 15:54:34 +03:00
|
|
|
implementation(project(":jni:jvm:all"))
|
2020-07-02 12:19:29 +02:00
|
|
|
}
|
|
|
|
compilations["test"].dependencies {
|
|
|
|
implementation(kotlin("test-junit"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-25 14:27:02 +02:00
|
|
|
if (includeAndroid) {
|
2024-01-23 15:44:06 +01:00
|
|
|
androidTarget {
|
2021-10-25 14:27:02 +02:00
|
|
|
compilations.all {
|
|
|
|
kotlinOptions.jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
sourceSets["androidMain"].dependencies {
|
|
|
|
implementation(project(":jni:android"))
|
|
|
|
}
|
2024-01-23 15:44:06 +01:00
|
|
|
sourceSets["androidUnitTest"].dependencies {
|
2021-10-25 14:27:02 +02:00
|
|
|
implementation(kotlin("test-junit"))
|
|
|
|
implementation("androidx.test.ext:junit:1.1.2")
|
|
|
|
implementation("androidx.test.espresso:espresso-core:3.3.0")
|
|
|
|
}
|
2020-07-02 12:19:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-23 15:44:06 +01:00
|
|
|
linuxX64()
|
|
|
|
iosX64()
|
|
|
|
iosArm64()
|
|
|
|
iosSimulatorArm64()
|
2020-07-02 12:19:29 +02:00
|
|
|
}
|
|
|
|
|
2021-10-25 14:27:02 +02:00
|
|
|
val includeAndroid = System.getProperty("includeAndroid")?.toBoolean() ?: true
|
|
|
|
if (includeAndroid) {
|
|
|
|
extensions.configure<com.android.build.gradle.LibraryExtension>("android") {
|
|
|
|
defaultConfig {
|
2024-01-23 15:44:06 +01:00
|
|
|
compileSdk = 30
|
|
|
|
minSdk = 21
|
2021-10-25 14:27:02 +02:00
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
2020-07-02 12:19:29 +02:00
|
|
|
|
2021-10-25 14:27:02 +02:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
2020-07-02 12:19:29 +02:00
|
|
|
|
2021-10-25 14:27:02 +02:00
|
|
|
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
|
2020-07-02 12:19:29 +02:00
|
|
|
|
2021-10-25 14:27:02 +02:00
|
|
|
afterEvaluate {
|
|
|
|
tasks.withType<com.android.build.gradle.tasks.factory.AndroidUnitTest>().all {
|
|
|
|
enabled = false
|
|
|
|
}
|
2020-07-02 12:19:29 +02:00
|
|
|
}
|
|
|
|
}
|
2021-10-25 14:27:02 +02:00
|
|
|
}
|