/
build.gradle.kts
90 lines (82 loc) · 2.53 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
import java.util.*
plugins {
kotlin("multiplatform") version "1.9.21"
kotlin("plugin.serialization") version "1.9.23"
id("dev.petuska.npm.publish") version "3.4.2"
java
}
group = "com.marcinmoskala"
val libVersion = "0.0.44"
version = libVersion
repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser()
binaries.library()
// Uncomment for running locally
// binaries.executable()
}
sourceSets {
val ktorVersion = "2.3.9"
val coroutinesVersion = "1.8.1-Beta"
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
implementation("net.mamoe.yamlkt:yamlkt:0.13.0")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutinesVersion")
// ...
}
}
val jvmTest by getting
val jsMain by getting
val jsTest by getting
}
}
val properties = Properties().apply {
rootProject.file("local.properties")
.takeIf { it.exists() }
?.reader()
?.let { load(it) }
}
npmPublish {
packages {
named("js") {
packageName.set("anki-markdown")
version.set(libVersion)
}
}
registries {
register("npmjs") {
uri.set(uri("https://registry.npmjs.org")) //
authToken.set((properties["npmSecret"] as? String).orEmpty())
}
}
}