Migrating to new plugin (not working with three-js yet)

This commit is contained in:
Alexander Nozik 2019-07-21 18:21:13 +03:00
parent a7fd76a4f5
commit effa19a95e
9 changed files with 80 additions and 84 deletions

View File

@ -1,12 +1,17 @@
val dataforgeVersion by extra("0.1.3-dev-9")
plugins{
kotlin("jvm") version "1.3.41" apply false
id("kotlin2js") version "1.3.41" apply false
id("kotlin-dce-js") version "1.3.41" apply false
val kotlinVersion = "1.3.50-eap-5"
kotlin("jvm") version kotlinVersion apply false
id("kotlin2js") version kotlinVersion apply false
id("kotlin-dce-js") version kotlinVersion apply false
id("org.jetbrains.kotlin.frontend") version "0.0.45" apply false
id("scientifik.mpp") version "0.1.3" apply false
id("scientifik.publish") version "0.1.3" apply false
id("scientifik.mpp") version "0.1.4-dev" apply false
id("scientifik.jvm") version "0.1.4-dev" apply false
id("scientifik.js") version "0.1.4-dev" apply false
id("scientifik.publish") version "0.1.4-dev" apply false
id("org.openjfx.javafxplugin") version "0.0.7" apply false
}
allprojects {
@ -16,10 +21,12 @@ allprojects {
maven("https://kotlin.bintray.com/kotlinx")
maven("http://npm.mipt.ru:8081/artifactory/gradle-dev-local")
maven("https://kotlin.bintray.com/js-externals")
maven("https://dl.bintray.com/pdvrieze/maven")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
}
group = "hep.dataforge"
version = "0.1.0"
version = "0.1.0-dev"
}
val githubProject by extra("dataforge-vis")

View File

@ -2,6 +2,10 @@ plugins {
id("scientifik.mpp")
}
scientifik{
serialization = true
}
val dataforgeVersion: String by rootProject.extra
kotlin {
@ -9,18 +13,11 @@ kotlin {
val commonMain by getting {
dependencies {
api("hep.dataforge:dataforge-output:$dataforgeVersion")
// api("hep.dataforge:dataforge-output-metadata:$dataforgeVersion")
}
}
val jvmMain by getting {
dependencies {
// api("hep.dataforge:dataforge-output-jvm:$dataforgeVersion")
}
}
val jsMain by getting {
dependencies {
api("hep.dataforge:dataforge-output-html:$dataforgeVersion")
// api("hep.dataforge:dataforge-output-js:$dataforgeVersion")
}
}
}

View File

@ -5,6 +5,7 @@
*/
package hep.dataforge.vis.fx.meta
import hep.dataforge.context.Global
import hep.dataforge.descriptors.NodeDescriptor
import hep.dataforge.meta.Config
import hep.dataforge.names.NameToken
@ -30,7 +31,7 @@ class ConfigEditor(
) : Fragment(title = title, icon = dfIconView) {
constructor(config: Config, descriptor: NodeDescriptor, title: String = "Configuration editor") :
this(FXMeta.root(config, descriptor = descriptor),title = title)
this(FXMeta.root(config, descriptor = descriptor), title = title)
override val root = borderpane {
center = treetableview<FXMeta<Config>> {
@ -124,13 +125,13 @@ class ConfigEditor(
when (item) {
is FXMetaValue<Config> -> {
text = null
val chooser = ValueChooser.build(item.valueProperty, item.descriptor) {
val chooser = ValueChooser.build(Global, item.valueProperty, item.descriptor) {
item.set(it)
}
graphic = chooser.node
}
is FXMetaNode<Config> -> {
if(allowNew) {
if (allowNew) {
text = null
graphic = hbox {
button("node", Glyph("FontAwesome", "PLUS_CIRCLE")) {

View File

@ -1,8 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.openjfx.gradle.JavaFXOptions
plugins {
kotlin("jvm")
id("scientifik.jvm")
id("org.openjfx.javafxplugin")
}
@ -14,10 +13,4 @@ dependencies {
configure<JavaFXOptions> {
modules("javafx.controls")
}
tasks.withType<KotlinCompile> {
kotlinOptions{
jvmTarget = "1.8"
}
}

View File

@ -2,10 +2,6 @@ plugins {
id("scientifik.mpp")
}
repositories{
maven("https://dl.bintray.com/pdvrieze/maven")
}
kotlin {
sourceSets {
val commonMain by getting {

View File

@ -39,7 +39,7 @@ private fun VisualGroup.addSolid(root: GDML, solid: GDMLSolid, block: VisualObje
}
}
solid.sections.sortedBy { it.zOrder }.forEach { section ->
layer(section.zPosition ?: 0f, section.xOffset, section.yOffset, section.scalingFactor)
layer(section.zPosition, section.xOffset, section.yOffset, section.scalingFactor)
}
}
is GDMLScaledSolid -> {

View File

@ -1,16 +1,6 @@
import org.jetbrains.kotlin.gradle.frontend.KotlinFrontendExtension
import org.jetbrains.kotlin.gradle.frontend.npm.NpmExtension
import org.jetbrains.kotlin.gradle.frontend.webpack.WebPackExtension
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
plugins {
id("kotlin2js")
id("scientifik.js")
id("kotlin-dce-js")
id("org.jetbrains.kotlin.frontend")
}
repositories{
maven("https://dl.bintray.com/pdvrieze/maven")
}
//val kotlinVersion: String by rootProject.extra
@ -22,48 +12,58 @@ dependencies {
testCompile(kotlin("test-js"))
}
configure<KotlinFrontendExtension> {
downloadNodeJsVersion = "latest"
configure<NpmExtension> {
dependency("three","0.106.2")
dependency("@hi-level/three-csg")
dependency("style-loader")
dependency("element-resize-event")
devDependency("karma")
}
sourceMaps = true
bundle<WebPackExtension>("webpack") {
this as WebPackExtension
bundleName = "main"
contentPath = file("src/main/web")
sourceMapEnabled = true
//mode = "production"
mode = "development"
kotlin{
sourceSets["main"].dependencies{
api(npm("three","0.106.2"))
implementation(npm("@hi-level/three-csg"))
implementation(npm("style-loader"))
implementation(npm("element-resize-event"))
}
}
tasks {
"compileKotlin2Js"(Kotlin2JsCompile::class) {
kotlinOptions {
metaInfo = true
outputFile = "${project.buildDir.path}/js/${project.name}.js"
sourceMap = true
moduleKind = "commonjs"
main = "call"
kotlinOptions.sourceMapEmbedSources = "always"
}
}
"compileTestKotlin2Js"(Kotlin2JsCompile::class) {
kotlinOptions {
metaInfo = true
outputFile = "${project.buildDir.path}/js/${project.name}-test.js"
sourceMap = true
moduleKind = "commonjs"
kotlinOptions.sourceMapEmbedSources = "always"
}
}
}
//
//configure<KotlinFrontendExtension> {
// downloadNodeJsVersion = "latest"
//
// configure<NpmExtension> {
// dependency("three","0.106.2")
// dependency("@hi-level/three-csg")
// dependency("style-loader")
// dependency("element-resize-event")
// devDependency("karma")
// }
//
// sourceMaps = true
//
// bundle<WebPackExtension>("webpack") {
// this as WebPackExtension
// bundleName = "main"
// contentPath = file("src/main/web")
// sourceMapEnabled = true
// //mode = "production"
// mode = "development"
// }
//}
//
//tasks {
// "compileKotlin2Js"(Kotlin2JsCompile::class) {
// kotlinOptions {
// metaInfo = true
// outputFile = "${project.buildDir.path}/js/${project.name}.js"
// sourceMap = true
// moduleKind = "commonjs"
// main = "call"
// kotlinOptions.sourceMapEmbedSources = "always"
// }
// }
//
// "compileTestKotlin2Js"(Kotlin2JsCompile::class) {
// kotlinOptions {
// metaInfo = true
// outputFile = "${project.buildDir.path}/js/${project.name}-test.js"
// sourceMap = true
// moduleKind = "commonjs"
// kotlinOptions.sourceMapEmbedSources = "always"
// }
// }
//}

View File

@ -3,8 +3,8 @@ package hep.dataforge.vis.spatial
import hep.dataforge.meta.EmptyMeta
import hep.dataforge.meta.Meta
import hep.dataforge.meta.seal
import hep.dataforge.vis.common.VisualGroup
import hep.dataforge.vis.common.DisplayLeaf
import hep.dataforge.vis.common.VisualGroup
import hep.dataforge.vis.common.VisualObject
enum class CompositeType {

View File

@ -3,8 +3,10 @@ pluginManagement {
mavenLocal()
jcenter()
gradlePluginPortal()
maven("https://kotlin.bintray.com/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://dl.bintray.com/mipt-npm/scientifik")
maven("https://dl.bintray.com/mipt-npm/dev")
}
resolutionStrategy {
@ -17,7 +19,7 @@ pluginManagement {
"kotlin-dce-js" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
"kotlin2js" -> useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
"org.jetbrains.kotlin.frontend" -> useModule("org.jetbrains.kotlin:kotlin-frontend-plugin:${requested.version}")
"scientifik.mpp", "scientifik.publish" -> useModule("scientifik:gradle-tools:${requested.version}")
"scientifik.mpp", "scientifik.publish", "scientifik.jvm", "scientifik.js" -> useModule("scientifik:gradle-tools:${requested.version}")
"org.openjfx.javafxplugin" -> useModule("org.openjfx:javafx-plugin:${requested.version}")
}
}