-
Notifications
You must be signed in to change notification settings - Fork 106
/
build.gradle
119 lines (106 loc) · 2.56 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
117
118
119
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
buildscript {
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.17.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.1'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.8.10'
}
ext.versions = [
'coroutines': '1.6.4',
]
}
apply plugin: 'org.jetbrains.kotlin.multiplatform'
kotlin {
explicitApi()
js {
nodejs {
testTask {
useMocha {
timeout = "5s"
}
}
}
}
jvm {
compilations.configureEach { KotlinJvmCompilation compilation ->
compilation.compilerOptions.options.jvmTarget = JvmTarget.JVM_1_8
}
}
iosArm32()
iosArm64()
iosX64()
iosSimulatorArm64()
linuxX64()
macosX64()
macosArm64()
mingwX64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
watchosArm32()
watchosArm64()
watchosX86()
watchosX64()
watchosSimulatorArm64()
sourceSets {
commonMain {
dependencies {
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:${versions.coroutines}"
}
}
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test'
}
}
nonJvmTest {
dependsOn(commonTest)
}
}
sourceSets.matching { it.name.endsWith("Test") }.all {
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)
}
}
}
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target("src/**/*.kt")
ktlint('0.48.2').editorConfigOverride([
'ktlint_standard_filename': 'disabled',
])
}
}
apply plugin: 'com.vanniktech.maven.publish'
apply plugin: 'org.jetbrains.dokka'
dokkaHtml {
dokkaSourceSets {
configureEach {
skipDeprecated.set(true)
externalDocumentationLink {
url.set(new URL('https://kotlin.github.io/kotlinx.coroutines/'))
}
}
}
}
buildscript {
repositories {
mavenCentral()
}
}
repositories {
mavenCentral()
}