-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
95 lines (80 loc) · 2.62 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
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.*
plugins {
kotlin("multiplatform")
}
group = "me.az"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
mavenLocal()
}
val koolVersion: String by project
kotlin {
// android()
js(IR) {
browser {
binaries.executable()
@Suppress("EXPERIMENTAL_API_USAGE")
distribution {
directory = File("${rootDir}/dist/")
name = "app"
}
commonWebpackConfig {
// small js code
//mode = KotlinWebpackConfig.Mode.PRODUCTION
// readable js code but ~twice the file size
mode = if(project.hasProperty("prod")) Mode.PRODUCTION else Mode.DEVELOPMENT
cssSupport.enabled = true
//outputPath = File(buildDir, "/processedResources/js/main/")
}
}
}
jvm {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = freeCompilerArgs + "-Xbackend-threads=0"
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("de.fabmax.kool:kool-core:${koolVersion}")
// implementation(":kool-core")
implementation(kotlin("stdlib-common"))
}
}
val jsMain by getting {
dependencies {
//implementation(npm("pako", "2.0.4"))
implementation("de.fabmax.kool:kool-core-js:${koolVersion}")
}
}
val jvmMain by getting {
dependencies {
implementation(DepsJvm.lwjgl())
implementation(DepsJvm.lwjgl("stb"))
runtimeOnly(DepsJvm.lwjglNatives("stb"))
runtimeOnly(DepsJvm.lwjglNatives())
runtimeOnly(DepsJvm.lwjglNatives("glfw"))
runtimeOnly(DepsJvm.lwjglNatives("jemalloc"))
runtimeOnly(DepsJvm.lwjglNatives("opengl"))
runtimeOnly(DepsJvm.lwjglNatives("vma"))
runtimeOnly(DepsJvm.lwjglNatives("shaderc"))
runtimeOnly(DepsJvm.lwjglNatives("nfd"))
implementation("de.fabmax.kool:kool-core-jvm:${koolVersion}")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
}
}
tasks["clean"].doLast {
delete("${rootDir}/dist/")
delete(rootProject.buildDir)
}