-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
executable file
·46 lines (39 loc) · 1.05 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
plugins {
kotlin("multiplatform") version "1.3.30"
id("com.github.salomonbrys.gradle.kotlin.js.mpp-assemble-web")
}
repositories {
mavenCentral()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
kotlin {
js() {
compilations["main"].kotlinOptions.outputFile = "${projectDir}/build/js/webgl2-sandbox.js"
// compilations["main"].kotlinOptions.moduleKind = "plain"
assembleWeb { thisTarget() }
}
sourceSets {
val jsMain by getting {
kotlin.srcDir("src")
dependencies {
implementation(kotlin("stdlib-js"))
}
}
}
}
val copyRuntime by tasks.creating(Copy::class) {
from("build/web/js") {
include("*")
}
into("dist/lib")
}
val copyMain by tasks.creating(Copy::class) {
from("build/js") {
include("*.js*")
}
into("dist")
}
val assemble = tasks.getByName("assemble")
assemble.finalizedBy(copyRuntime)
assemble.finalizedBy(copyMain)