numass/numass-data-server/build.gradle.kts

61 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-11-27 22:03:10 +03:00
plugins {
id("space.kscience.gradle.mpp")
2021-11-27 22:03:10 +03:00
`maven-publish`
}
val visionForgeVersion: String by rootProject.extra
2022-11-23 13:51:53 +03:00
val production: Boolean by rootProject.extra(true)
2021-11-27 22:03:10 +03:00
kotlin {
js(IR) {
2021-11-27 22:03:10 +03:00
browser {
webpackTask {
this.outputFileName = "js/numass-web.js"
}
}
binaries.executable()
}
sourceSets {
commonMain {
dependencies {
implementation(project(":numass-data-model"))
2022-11-23 13:51:53 +03:00
implementation("space.kscience:visionforge-core:$visionForgeVersion")
2021-11-27 22:03:10 +03:00
implementation("space.kscience:visionforge-plotly:$visionForgeVersion")
}
}
jvmMain {
dependencies {
implementation(project(":numass-data-proto"))
implementation("space.kscience:visionforge-server:$visionForgeVersion")
}
}
}
}
afterEvaluate {
val distributionTask = if (production) {
tasks.getByName("jsBrowserDistribution")
} else {
tasks.getByName("jsBrowserDevelopmentExecutableDistribution")
}
tasks.getByName<ProcessResources>("jvmProcessResources") {
dependsOn(distributionTask)
from(distributionTask)
include("**/*.js")
if (production) {
include("**/*.map")
}
}
}
kscience {
2021-11-27 22:03:10 +03:00
useSerialization {
json()
}
withContextReceivers()
2021-11-27 22:03:10 +03:00
}