-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathbuild.gradle
116 lines (99 loc) · 2.26 KB
/
build.gradle
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlinApiDump)
alias(libs.plugins.spotless)
alias(libs.plugins.publish)
alias(libs.plugins.dokka)
}
kotlin {
explicitApi()
androidNativeArm32()
androidNativeArm64()
androidNativeX64()
androidNativeX86()
iosArm64()
iosSimulatorArm64()
iosX64()
js {
nodejs {
testTask {
useMocha {
timeout = "5s"
}
}
}
}
jvm {
compilations.configureEach { KotlinJvmCompilation compilation ->
compilation.compilerOptions.options.jvmTarget = JvmTarget.JVM_1_8
compilation.compilerOptions.options.freeCompilerArgs.add("-Xjvm-default=all")
}
}
linuxArm64()
linuxX64()
macosArm64()
macosX64()
mingwX64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
wasmJs()
wasmWasi {
nodejs()
}
watchosArm32()
watchosArm64()
watchosDeviceArm64()
watchosSimulatorArm64()
watchosX64()
sourceSets {
commonMain {
dependencies {
api libs.coroutines.core
implementation libs.coroutines.test
}
}
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test'
}
}
nonJvmTest {
dependsOn(commonTest)
}
}
sourceSets.matching { it.name.endsWith("Test") }.configureEach {
it.languageSettings {
optIn('kotlinx.coroutines.DelicateCoroutinesApi')
optIn('kotlinx.coroutines.InternalCoroutinesApi')
optIn('kotlinx.coroutines.ExperimentalCoroutinesApi')
}
}
targets.each { target ->
if (target.platformType == KotlinPlatformType.common) return
if (target.platformType != KotlinPlatformType.jvm) {
target.compilations.test.defaultSourceSet.dependsOn(sourceSets.nonJvmTest)
}
}
}
spotless {
kotlin {
target("src/**/*.kt")
ktlint('0.48.2').editorConfigOverride([
'ktlint_standard_filename': 'disabled',
])
}
}
dokkaHtml {
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
externalDocumentationLink {
url.set(new URL('https://kotlin.github.io/kotlinx.coroutines/'))
}
}
}
}