-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
106 lines (87 loc) · 2.79 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
plugins {
kotlin("multiplatform") version Config.Versions.Kotlin.kotlin
kotlin("plugin.serialization") version Config.Versions.Kotlin.kotlin
}
group = "com.petersamokhin"
version = "0.0.1"
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.vanniktech:gradle-maven-publish-plugin:${Config.Versions.Plugin.publish}")
}
}
repositories {
mavenCentral()
}
kotlin {
explicitApiWarning()
jvm()
js {
nodejs()
compilations.all {
kotlinOptions {
sourceMap = true
moduleKind = "umd"
metaInfo = true
}
}
}
@Suppress("UNUSED_VARIABLE")
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:${Config.Versions.Kotlin.serialization}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${Config.Versions.Kotlin.serialization}")
implementation("io.ktor:ktor-client-core:${Config.Versions.ktor}")
implementation("io.ktor:ktor-client-serialization:${Config.Versions.ktor}")
implementation("co.touchlab:stately-common:${Config.Versions.stately}")
implementation("co.touchlab:stately-concurrency:${Config.Versions.stately}")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val nativeMain by creating {
dependsOn(commonMain)
}
val darwinMain by creating {
dependsOn(nativeMain)
}
val linuxMain by creating {
dependsOn(nativeMain)
}
val mingwMain by creating {
dependsOn(nativeMain)
}
all {
languageSettings.optIn("kotlin.RequiresOptIn")
}
}
listOf(
"iosX64", "iosArm32", "iosArm64", "tvosX64", "tvosArm64", "watchosX86", "watchosArm32", "watchosArm64", "macosX64"
).forEach {
targetFromPreset(presets[it], it) {
compilations["main"].source(sourceSets["darwinMain"])
}
}
listOf(
// https://github.com/Kotlin/kotlinx.coroutines/issues/855
// "linuxArm32Hfp", "linuxMips32",
"linuxX64"
).forEach {
targetFromPreset(presets[it], it) {
compilations["main"].source(sourceSets["linuxMain"])
}
}
targetFromPreset(presets["mingwX64"], "mingwX64") {
compilations["main"].source(sourceSets["mingwMain"])
}
}
apply(from = "$rootDir/gradle/mavenpublish.gradle")