visionforge/demo/muon-monitor/build.gradle.kts

86 lines
2.4 KiB
Plaintext
Raw Normal View History

2020-03-16 22:24:57 +03:00
import scientifik.jsDistDirectory
2019-12-26 22:21:10 +03:00
plugins {
id("scientifik.mpp")
id("application")
}
group = "ru.mipt.npm"
2020-03-23 22:19:52 +03:00
val ktorVersion = "1.3.2"
2019-12-30 11:40:37 +03:00
2019-12-26 22:21:10 +03:00
kotlin {
2020-03-17 11:36:17 +03:00
val installJS = tasks.getByName("jsBrowserDistribution")
2019-12-30 17:14:42 +03:00
js{
browser {
dceTask {
dceOptions {
keep("ktor-ktor-io.\$\$importsForInline\$\$.ktor-ktor-io.io.ktor.utils.io")
}
}
webpackTask {
mode = org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.Mode.PRODUCTION
}
}
}
2019-12-30 17:14:42 +03:00
jvm {
withJava()
compilations.findByName("main").apply {
2019-12-30 17:14:42 +03:00
tasks.getByName<ProcessResources>("jvmProcessResources") {
dependsOn(installJS)
afterEvaluate {
2020-03-16 22:24:57 +03:00
from(project.jsDistDirectory)
2019-12-30 17:14:42 +03:00
}
}
}
}
2019-12-26 22:21:10 +03:00
sourceSets {
commonMain {
dependencies {
2019-12-30 11:40:37 +03:00
implementation(project(":dataforge-vis-spatial"))
}
}
2019-12-30 17:14:42 +03:00
jvmMain {
2019-12-30 11:40:37 +03:00
dependencies {
implementation("org.apache.commons:commons-math3:3.6.1")
2020-03-23 22:19:52 +03:00
implementation("io.ktor:ktor-server-cio:$ktorVersion")
implementation("io.ktor:ktor-serialization:$ktorVersion")
2019-12-26 22:21:10 +03:00
}
}
2020-03-16 22:24:57 +03:00
jsMain {
dependencies {
2020-03-23 22:19:52 +03:00
implementation("io.ktor:ktor-client-js:$ktorVersion")
implementation("io.ktor:ktor-client-serialization-js:$ktorVersion")
2019-12-31 16:06:38 +03:00
implementation(npm("text-encoding"))
implementation(npm("abort-controller"))
2020-03-23 22:19:52 +03:00
implementation(npm("bufferutil"))
implementation(npm("utf-8-validate"))
2020-04-10 19:25:52 +03:00
implementation(npm("fs"))
2020-03-23 22:19:52 +03:00
// implementation(npm("jquery"))
// implementation(npm("popper.js"))
// implementation(npm("react-is"))
2019-12-31 16:06:38 +03:00
}
}
2019-12-26 22:21:10 +03:00
}
}
application {
2020-03-23 22:19:52 +03:00
mainClassName = "ru.mipt.npm.muon.monitor.server.MMServerKt"
2019-12-26 22:21:10 +03:00
}
2019-12-31 16:06:38 +03:00
//configure<JavaFXOptions> {
// modules("javafx.controls")
2020-04-16 12:46:54 +03:00
//}
val common = project(":dataforge-vis-common")
val copyJsResourcesFromCommon by tasks.creating(Copy::class){
from(common.buildDir.resolve("processedResources\\js\\main\\"))
into(buildDir.resolve("processedResources\\js\\main\\"))
}
tasks.getByPath("jsProcessResources").dependsOn(copyJsResourcesFromCommon)