visionforge/visionforge-threejs/visionforge-threejs-server/build.gradle.kts

59 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-12-12 21:19:41 +03:00
plugins {
2022-08-12 22:16:06 +03:00
id("space.kscience.gradle.mpp")
2022-08-14 17:22:10 +03:00
}
2020-12-12 21:19:41 +03:00
val ktorVersion: String by rootProject.extra
kotlin {
2022-08-14 17:22:10 +03:00
js(IR) {
2020-12-12 21:19:41 +03:00
browser {
webpackTask {
this.outputFileName = "js/visionforge-three.js"
}
2023-01-17 19:20:48 +03:00
commonWebpackConfig {
cssSupport{
enabled.set(false)
}
}
2020-12-12 21:19:41 +03:00
}
binaries.executable()
}
sourceSets {
commonMain {
dependencies {
2023-01-17 19:20:48 +03:00
api(projects.visionforgeSolid)
2020-12-12 21:19:41 +03:00
}
}
jvmMain {
dependencies {
2023-01-17 19:20:48 +03:00
api(projects.visionforgeServer)
2020-12-12 21:19:41 +03:00
}
}
jsMain {
dependencies {
2023-01-17 19:20:48 +03:00
api(projects.visionforgeThreejs)
api(projects.ui.ring)
2020-12-12 21:19:41 +03:00
}
}
}
2022-08-14 17:22:10 +03:00
}
val jsBrowserDistribution by tasks.getting
val jsBrowserDevelopmentExecutableDistribution by tasks.getting
val devMode = rootProject.findProperty("visionforge.development") as? Boolean
?: rootProject.version.toString().contains("dev")
tasks.getByName<ProcessResources>("jvmProcessResources") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
if (devMode) {
dependsOn(jsBrowserDevelopmentExecutableDistribution)
from(jsBrowserDevelopmentExecutableDistribution)
} else {
dependsOn(jsBrowserDistribution)
from(jsBrowserDistribution)
}
}