-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
111 lines (97 loc) · 3.07 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
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
plugins {
kotlin("multiplatform") version "2.0.21"
id("dev.petuska.npm.publish") version "3.4.3"
}
group = "com.dzikoysk"
version = "1.0.17"
repositories {
mavenCentral()
}
kotlin {
js(IR) {
browser()
generateTypeScriptDefinitions()
binaries.library()
}
jvm {
withJava()
compilations {
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("de.cketti.unicode:kotlin-codepoints-deluxe:0.9.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jsMain by getting
val jsTest by getting
val jvmMain by getting
val jvmTest by getting
}
}
npmPublish {
readme.set(file("README.md"))
packages {
named("js") {
packageJson {
description.set("Hangul processor for Kotlin Multiplatform & JavaScript projects, based on reverse-engineered Branah keyboard algorithm")
author {
name.set("dzikoysk")
}
repository {
type.set("git")
url.set("https://github.com/dzikoysk/khangul")
}
bugs {
url.set("https://github.com/dzikoysk/khangul")
}
}
}
}
registries {
register("npmjs") {
uri.set("https://registry.npmjs.org")
authToken.set(property("npm.token").toString())
}
}
}
tasks.register("publishNpm") {
dependsOn(
"clean",
"allTests",
"assembleJsPackage",
"packJsPackage",
"publishJsPackageToNpmjsRegistry"
)
tasks.findByName("test")?.mustRunAfter("clean")
tasks.findByName("kotlinStoreYarnLock")?.dependsOn("kotlinUpgradeYarnLock")
tasks.findByName("assembleJsPackage")?.mustRunAfter("allTests")
tasks.findByName("packJsPackage")?.mustRunAfter("assembleJsPackage")
tasks.findByName("publishJsPackageToNpmjsRegistry")?.mustRunAfter("packJsPackage")
}
// https://kotlinlang.org/docs/whatsnew18.html#new-settings-for-reporting-that-yarn-lock-has-been-updated
rootProject.plugins.withType(YarnPlugin::class.java) {
rootProject.the<YarnRootExtension>().yarnLockMismatchReport = YarnLockMismatchReport.WARNING // NONE | FAIL
rootProject.the<YarnRootExtension>().reportNewYarnLock = false // true
rootProject.the<YarnRootExtension>().yarnLockAutoReplace = true // true
}