2 Commits
1.1 ... master

3 changed files with 16 additions and 12 deletions

View File

@@ -1,8 +1,5 @@
group 'ninja.javafx'
version '1.1-SNAPSHOT'
buildscript { buildscript {
ext.kotlin_version = '1.0.4' ext.kotlin_version = '1.3.72'
repositories { repositories {
mavenCentral() mavenCentral()
@@ -12,18 +9,27 @@ buildscript {
} }
} }
apply plugin: 'kotlin' plugins {
apply plugin: 'application' id "org.jetbrains.kotlin.jvm" version "$kotlin_version"
id 'application'
mainClassName = 'ninja.javafx.smartcsv.fx.converter.ConverterFX' id 'org.openjfx.javafxplugin' version '0.0.8'
}
repositories { repositories {
mavenCentral() mavenCentral()
jcenter() jcenter()
} }
javafx {
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
dependencies { dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.beust:klaxon:0.24' compile 'com.beust:klaxon:0.24'
compile 'no.tornado:tornadofx:1.5.6' compile 'no.tornado:tornadofx:1.5.6'
} }
group 'ninja.javafx'
version '1.1-SNAPSHOT'
mainClassName = 'ninja.javafx.smartcsv.fx.converter.ConverterFX'

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip

View File

@@ -85,11 +85,9 @@ class Converter(val name: String) {
} }
@Suppress("UNCHECKED_CAST")
fun constraint(column : JsonObject, key : String, value: Any?) { fun constraint(column : JsonObject, key : String, value: Any?) {
if (value == null) return if (value == null) return
val constraints = column["constraints"] as JsonObject? ?: JsonObject(HashMap<String, Any>()) val constraints = column.getOrPut("constraints") { JsonObject(mutableMapOf()) } as JsonObject
column["constraints"] = constraints
constraints[key] = value constraints[key] = value
} }