-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
110 lines (92 loc) · 2.63 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
107
108
109
110
/*
* Copyright 2014-2020 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
val kotlin_version: String by extra
val atomicfu_version: String by extra
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version")
}
}
plugins {
kotlin("multiplatform") version "1.6.20"
id("org.jetbrains.kotlinx.kover") version "0.5.0"
`maven-publish`
}
group = "io.ktor"
repositories {
mavenLocal()
mavenCentral()
maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
apply(plugin = "kotlin-multiplatform")
apply(plugin = "kotlinx-atomicfu")
val coroutines_version: String by extra
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser()
nodejs()
}
val platforms: List<KotlinNativeTarget> = listOf(
mingwX64(),
linuxX64(),
macosX64(),
macosArm64(),
iosX64(),
iosArm64(),
iosArm32(),
iosSimulatorArm64(),
watchosX86(),
watchosX64(),
watchosArm32(),
watchosArm64(),
watchosSimulatorArm64(),
tvosX64(),
tvosArm64(),
tvosSimulatorArm64()
)
explicitApi()
sourceSets {
val commonMain by getting {
dependencies {
}
}
val commonTest by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation(kotlin("test"))
}
}
val nativeMain by creating
val nativeTest by creating
nativeMain.dependsOn(commonMain)
nativeTest.dependsOn(commonTest)
nativeTest.dependsOn(nativeMain)
val platformMain = platforms.map { sourceSets.getByName("${it.name}Main") }
val platformTest = platforms.map { sourceSets.getByName("${it.name}Test") }
platformMain.forEach {
it.dependsOn(nativeMain)
}
platformTest.forEach {
it.dependsOn(nativeTest)
}
}
}