-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
49 lines (41 loc) · 1.59 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
@file:Suppress("UnstableApiUsage")
plugins {
dev.suresh.plugin.kotlin.mpp
dev.suresh.plugin.publishing
}
description = "Kotlin JS/Wasm Web application"
val sharedJsRes by configurations.creating
val sharedWasmRes by configurations.creating
dependencies {
commonMainImplementation(projects.shared)
jsMainImplementation(npm("highlight.js", libs.versions.npm.highlightjs.get()))
jsMainImplementation(npm("@xterm/xterm", libs.versions.npm.xtermjs.get()))
jsMainImplementation(libs.kotlin.cryptography.webcrypto)
wasmJsMainImplementation(libs.kotlin.cryptography.webcrypto)
sharedJsRes(project(path = projects.shared.path, configuration = "sharedJsResources"))
sharedWasmRes(project(path = projects.shared.path, configuration = "sharedWasmResources"))
}
tasks {
val copySharedJsResources by
registering(Sync::class) {
from(sharedJsRes)
into(jsProcessResources.map { it.destinationDir })
includeEmptyDirs = false
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
val copySharedWasmResources by
registering(Sync::class) {
from(sharedWasmRes)
into(wasmJsProcessResources.map { it.destinationDir })
includeEmptyDirs = false
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
jsProcessResources { mustRunAfter(copySharedJsResources) }
wasmJsProcessResources { mustRunAfter(copySharedWasmResources) }
}
artifacts {
val jsApp by configurations.consumable("jsApp")
add(jsApp.name, tasks.jsBrowserDistribution)
val wasmApp by configurations.consumable("wasmApp")
add(wasmApp.name, tasks.wasmJsBrowserDistribution)
}