-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle.kts
184 lines (164 loc) · 4.91 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
@file:OptIn(ExperimentalWasmDsl::class)
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
`maven-publish`
}
repositories {
mavenCentral()
maven("https://maven.tryformation.com/releases") {
content {
includeGroup("com.jillesvangurp")
}
}
}
kotlin {
jvm {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}
js(IR) {
nodejs {
testTask {
useMocha {
// javascript is a lot slower than Java, we hit the default timeout of 2000
timeout = "60s"
}
}
}
}
linuxX64()
linuxArm64()
mingwX64()
macosX64()
macosArm64()
iosArm64()
iosX64()
iosSimulatorArm64()
wasmJs {
browser {
testTask {
useMocha {
timeout = "60s"
}
}
}
nodejs {
testTask {
useMocha {
timeout = "60s"
}
}
}
d8 {
testTask {
useMocha {
timeout = "60s"
}
}
}
}
// no kotest support yet for this
// wasmWasi()
sourceSets {
commonMain {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:_")
implementation("com.jillesvangurp:kotlinx-serialization-extensions:_")
}
}
commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
// yay kotest does multiplatform
implementation("io.kotest:kotest-assertions-core:_")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-cbor:_")
}
}
jvmMain {
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:_")
}
}
jvmTest {
dependencies {
runtimeOnly("org.junit.jupiter:junit-jupiter:_")
implementation(kotlin("test-junit"))
}
}
jsMain {
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:_")
}
}
jsTest {
dependencies {
implementation(kotlin("test-js"))
}
}
wasmJsTest {
dependencies {
implementation(kotlin("test-wasm-js"))
}
}
all {
languageSettings {
optIn("kotlin.RequiresOptIn")
// optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
languageVersion = "1.9"
apiVersion = "1.9"
}
}
}
}
tasks.named("iosSimulatorArm64Test") {
// requires IOS simulator and tens of GB of other stuff to be installed
// so keep it disabled
enabled = false
}
publishing {
publications {
withType<MavenPublication> {
pom {
name.set("GeoGeometry")
description.set("A Kotlin Multiplatform library for geospatial geometry operations.")
url.set("https://github.com/jillesvangurp/geogeometry")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/jillesvangurp/geogeometry/blob/master/LICENSE")
}
}
developers {
developer {
id.set("jillesvangurp")
name.set("Jilles van Gurp")
email.set("jilles@no-reply.github.com")
}
}
scm {
connection.set("scm:git:git://github.com/jillesvangurp/geogeometry.git")
developerConnection.set("scm:git:ssh://github.com:jillesvangurp/geogeometry.git")
url.set("https://github.com/jillesvangurp/geogeometry")
}
}
}
}
repositories {
maven {
// GOOGLE_APPLICATION_CREDENTIALS env var must be set for this to work
// public repository is at https://maven.tryformation.com/releases
url = uri("gcs://mvn-public-tryformation/releases")
name = "FormationPublic"
}
}
}