-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
101 lines (86 loc) · 2.62 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
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform") version "1.9.20" // kotlin_version
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
}
group = "org.openapitools"
version = "1.0.0"
val kotlin_version = "1.9.20"
val coroutines_version = "1.7.3"
val serialization_version = "1.6.1"
val ktor_version = "2.3.6"
repositories {
mavenCentral()
}
kotlin {
jvm()
iosX64()
iosArm64()
iosSimulatorArm64()
js {
browser()
nodejs()
}
sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
api("io.ktor:ktor-client-core:$ktor_version")
api("io.ktor:ktor-client-serialization:$ktor_version")
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
implementation("io.ktor:ktor-client-mock:$ktor_version")
}
}
jvmMain {
dependencies {
implementation(kotlin("stdlib-jdk7"))
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
}
}
jvmTest {
dependencies {
implementation(kotlin("test-junit"))
}
}
iosMain {
dependencies {
api("io.ktor:ktor-client-ios:$ktor_version")
}
}
jsMain {
dependencies {
api("io.ktor:ktor-client-js:$ktor_version")
}
}
all {
languageSettings.apply {
optIn("kotlin.Experimental")
}
}
}
}
tasks {
register("iosTest") {
val device = project.findProperty("device")?.toString() ?: "iPhone 8"
dependsOn("linkDebugTestIosX64")
group = JavaBasePlugin.VERIFICATION_GROUP
description = "Execute unit tests on ${device} simulator"
doLast {
val binary = kotlin.targets.getByName<KotlinNativeTarget>("iosX64").binaries.getTest("DEBUG")
exec {
commandLine("xcrun", "simctl", "spawn", device, binary.outputFile)
}
}
}
register("test") {
dependsOn("allTests")
}
}