-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
82 lines (68 loc) · 2.03 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@file:OptIn(ExperimentalKotlinGradlePluginApi::class)
@file:Suppress("PropertyName")
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
val _group = findProperty("group") as String
val _jvmTarget = findProperty("jvmTarget") as String
val _minSdk = (findProperty("android.minSdk") as String).toInt()
val _compileSdk = (findProperty("android.compileSdk") as String).toInt()
plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.compose).apply(false)
alias(libs.plugins.android.library)
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.buildConfig).apply(false)
alias(libs.plugins.kotlinx.serialization).apply(false)
}
subprojects {
val libs = listOf("domain")
if (!libs.contains(name)) return@subprojects
plugins.apply("com.android.library")
plugins.apply("org.jetbrains.kotlin.multiplatform")
kotlin {
androidTarget {
compilations.all {
kotlinOptions.jvmTarget = _jvmTarget
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = name
isStatic = true
}
}
sourceSets {
commonTest.dependencies {
implementation(kotlin("test"))
}
}
}
android {
namespace = "$_group.$name"
compileSdk = _compileSdk
defaultConfig { minSdk = _minSdk }
compileOptions {
val version = JavaVersion.toVersion(_jvmTarget)
sourceCompatibility = version
targetCompatibility = version
}
}
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions.jvmTarget = _jvmTarget
}
}
}
subprojects {
tasks.register("testClasses")
}
android {
namespace = (findProperty("group") as String)
compileSdk = (findProperty("android.compileSdk") as String).toInt()
}