2021-11-27 22:03:10 +03:00
|
|
|
plugins {
|
2022-06-07 12:44:30 +03:00
|
|
|
id("space.kscience.gradle.mpp")
|
2022-12-06 22:49:02 +03:00
|
|
|
id("org.jetbrains.compose")
|
2021-11-27 22:03:10 +03:00
|
|
|
`maven-publish`
|
|
|
|
}
|
|
|
|
|
2022-06-07 12:44:30 +03:00
|
|
|
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 {
|
2022-06-07 12:44:30 +03:00
|
|
|
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"))
|
2022-12-06 22:49:02 +03:00
|
|
|
implementation("io.ktor:ktor-server-cio:2.1.3")
|
|
|
|
implementation("io.ktor:ktor-server-html-builder-jvm:2.1.3")
|
|
|
|
implementation("space.kscience:visionforge-plotly:$visionForgeVersion")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
jsMain{
|
|
|
|
dependencies{
|
|
|
|
implementation(compose.web.core)
|
2021-11-27 22:03:10 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-07 12:44:30 +03:00
|
|
|
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()
|
|
|
|
}
|
2022-06-07 12:44:30 +03:00
|
|
|
withContextReceivers()
|
2021-11-27 22:03:10 +03:00
|
|
|
}
|