-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (96 loc) · 2.8 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
import dev.twarner.gradle.DownloadFirefoxTask
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("multiplatform") version "1.9.22"
`maven-publish`
kotlin("plugin.serialization") version "1.9.22"
id("dev.twarner.download-firefox") version "0.3.6"
}
allprojects {
group = "com.github.juggernaut0"
repositories {
mavenCentral()
maven("https://juggernaut0.github.io/m2/repository")
}
plugins.withId("maven-publish") {
publishing {
repositories {
maven {
name = "pages"
url = uri("$rootDir/pages/m2/repository")
}
}
}
}
}
val downloadFirefox = tasks.named("downloadFirefox", DownloadFirefoxTask::class) {
version.set("122.0.1")
}
kotlin {
jvm()
js(IR) {
browser {
testTask {
if (System.getProperty("os.name").contains("Mac")) {
doFirst {
environment("FIREFOX_BIN", "/Applications/Firefox.app/Contents/MacOS/firefox")
}
} else {
dependsOn(downloadFirefox)
doFirst {
environment("FIREFOX_BIN", downloadFirefox.flatMap { it.outputBin }.get().asFile.absolutePath)
}
}
useKarma {
useFirefoxHeadless()
}
}
}
}
val serializationVersion = "1.6.2"
sourceSets {
all {
languageSettings.apply {
optIn("kotlin.RequiresOptIn")
}
}
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
api("org.jetbrains.kotlinx:kotlinx-serialization-properties:$serializationVersion")
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation("io.mockk:mockk:1.13.9")
}
}
val jsMain by getting {
dependencies {
api("com.github.juggernaut0:async-lite:0.3.0")
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}
tasks {
withType<Kotlin2JsCompile>().configureEach {
kotlinOptions {
moduleKind = "umd"
sourceMap = true
sourceMapEmbedSources = "always"
}
}
withType<JavaCompile>().configureEach {
options.release = 17
}
withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "17"
}
}