70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
plugins {
|
|
id("space.kscience.gradle.mpp")
|
|
id("org.jetbrains.compose")
|
|
`maven-publish`
|
|
}
|
|
|
|
val visionForgeVersion: String by rootProject.extra
|
|
|
|
val production: Boolean by rootProject.extra(true)
|
|
|
|
kotlin {
|
|
js(IR) {
|
|
browser {
|
|
webpackTask {
|
|
this.outputFileName = "js/numass-web.js"
|
|
}
|
|
}
|
|
binaries.executable()
|
|
}
|
|
|
|
sourceSets {
|
|
commonMain {
|
|
dependencies {
|
|
implementation(project(":numass-data-model"))
|
|
implementation("space.kscience:visionforge-core:$visionForgeVersion")
|
|
implementation("space.kscience:visionforge-plotly:$visionForgeVersion")
|
|
implementation(compose.runtime)
|
|
}
|
|
}
|
|
jvmMain {
|
|
dependencies {
|
|
implementation(project(":numass-data-proto"))
|
|
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)
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
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 {
|
|
useSerialization {
|
|
json()
|
|
}
|
|
withContextReceivers()
|
|
}
|