-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathbuild.gradle.kts
84 lines (70 loc) · 2.58 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
83
84
plugins {
// Android plugin must be before multiplatform plugin until https://youtrack.jetbrains.com/issue/KT-34038 is fixed.
id("com.android.library")
kotlin("multiplatform")
id("kotlin-parcelize")
alias(libs.plugins.atomicfu)
id("org.jmailen.kotlinter")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
}
kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())
androidTarget().publishAllLibraryVariants()
iosArm64()
iosSimulatorArm64()
iosX64()
js().browser()
macosArm64()
macosX64()
jvm()
sourceSets {
all {
languageSettings {
optIn("kotlin.uuid.ExperimentalUuidApi")
}
}
commonMain.dependencies {
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.io)
implementation(libs.datetime)
implementation(libs.tuulbox.collections)
}
commonTest.dependencies {
implementation(kotlin("reflect")) // For `assertIs`.
implementation(kotlin("test"))
implementation(libs.khronicle)
implementation(libs.kotlinx.coroutines.test)
}
androidMain.dependencies {
api(libs.kotlinx.coroutines.android)
implementation(libs.androidx.core)
implementation(libs.androidx.startup)
// Workaround for AtomicFU plugin not automatically adding JVM dependency for Android.
// https://github.com/Kotlin/kotlinx-atomicfu/issues/145
implementation(libs.atomicfu)
implementation(libs.tuulbox.coroutines)
}
jsMain.dependencies {
api(libs.wrappers.web)
api(project.dependencies.platform(libs.wrappers.bom))
}
}
}
android {
compileSdk = libs.versions.android.compile.get().toInt()
defaultConfig.minSdk = libs.versions.android.min.get().toInt()
namespace = "com.juul.kable"
lint {
abortOnError = true
warningsAsErrors = true
disable += "AndroidGradlePluginVersion"
disable += "GradleDependency"
// Calls to many functions on `BluetoothDevice`, `BluetoothGatt`, etc require `BLUETOOTH_CONNECT` permission,
// which has been specified in the `AndroidManifest.xml`; rather than needing to annotate a number of classes,
// we disable the "missing permission" lint check. Caution must be taken during later Android version bumps to
// make sure we aren't missing any newly introduced permission requirements.
disable += "MissingPermission"
}
}