-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
156 lines (137 loc) · 4.07 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
156 lines (137 loc) · 4.07 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform") version "2.1.21" // kotlin_version
kotlin("plugin.serialization") version "2.1.21" // kotlin_version
id("com.vanniktech.maven.publish") version "0.30.0"
id("org.jetbrains.kotlinx.kover") version "0.9.0"
id("com.google.devtools.ksp") version "2.1.21-2.0.2"
}
group = "digital.guimauve.etsy"
version = "1.0.0"
val kotlin_version = "2.1.21"
val coroutines_version = "1.10.2"
val serialization_version = "1.8.1"
val ktor_version = "3.1.3"
repositories {
mavenCentral()
}
kotlin {
// Tiers are in accordance with <https://kotlinlang.org/docs/native-target-support.html>
// Tier 1
macosX64()
macosArm64()
iosSimulatorArm64()
iosX64()
// Tier 2
linuxX64()
linuxArm64()
watchosSimulatorArm64()
watchosX64()
watchosArm32()
watchosArm64()
tvosSimulatorArm64()
tvosX64()
tvosArm64()
iosArm64()
// Tier 3
mingwX64()
watchosDeviceArm64()
// jvm & js
jvmToolchain(21)
jvm {
testRuns.named("test") {
executionTask.configure {
useJUnitPlatform()
}
}
}
js {
generateTypeScriptDefinitions()
binaries.library()
nodejs()
browser()
}
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.6.2")
}
}
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")
}
}
}
}
mavenPublishing {
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
pom {
name.set("etsy")
description.set("Kotlin Etsy API client")
url.set("https://github.com/guimauvedigital/etsy")
licenses {
license {
name.set("Apache 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("NathanFallet")
name.set("Nathan Fallet")
email.set("contact@nathanfallet.me")
url.set("https://www.nathanfallet.me")
}
}
scm {
url.set("https://github.com/guimauvedigital/etsy.git")
}
}
}
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")
}
}