-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle.kts
154 lines (137 loc) · 3.74 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
@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"))
api("org.jetbrains.kotlinx:kotlinx-serialization-json:_")
api("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:_")
api("org.jetbrains.kotlinx:kotlinx-serialization-cbor:_")
}
}
jvmMain {
dependencies {
implementation(kotlin("stdlib-jdk8"))
api("org.jetbrains.kotlinx:kotlinx-serialization-json:_")
}
}
jvmTest {
dependencies {
runtimeOnly("org.junit.jupiter:junit-jupiter:_")
implementation(kotlin("test-junit"))
}
}
jsMain {
dependencies {
implementation(kotlin("stdlib-js"))
api("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 {
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"
}
}
}