Upgrade Gradle, Kotlin, and libraries

This commit is contained in:
Daniel Wolf 2019-07-06 23:24:09 +02:00
parent 460378bf50
commit b9a75662db
7 changed files with 22 additions and 33 deletions

View File

@ -1,3 +1,7 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.41'
}
def getVersion() {
// Dynamically read version from CMake file
String text = new File('../../appInfo.cmake').getText('UTF-8')
@ -12,29 +16,16 @@ def getVersion() {
group 'com.rhubarb_lip_sync'
version = getVersion()
buildscript {
ext.kotlin_version = '1.1.60'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile 'com.beust:klaxon:0.30'
compile 'org.apache.commons:commons-lang3:3.7'
compile 'no.tornado:tornadofx:1.7.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'com.beust:klaxon:5.0.1'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'no.tornado:tornadofx:1.7.19'
}
compileKotlin {

View File

@ -1,5 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -6,6 +6,7 @@ import javafx.beans.property.SimpleListProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.beans.property.SimpleStringProperty
import javafx.collections.ObservableList
import tornadofx.asObservable
import java.nio.file.Path
import tornadofx.getValue
import tornadofx.observable
@ -61,7 +62,7 @@ class AnimationFileModel(val parentModel: MainModel, animationFilePath: Path, pr
audioFileModel = AudioFileModel(event, this, executor, reportResult)
return@map audioFileModel
}
.observable()
.asObservable()
)
val audioFileModels: ObservableList<AudioFileModel> by audioFileModelsProperty
@ -97,7 +98,7 @@ class AnimationFileModel(val parentModel: MainModel, animationFilePath: Path, pr
}
init {
slots = spineJson.slots.observable()
slots = spineJson.slots.asObservable()
mouthSlot = spineJson.guessMouthSlot()
}

View File

@ -115,13 +115,13 @@ class MainView : View() {
placeholder = Label("There are no events with associated audio files.")
columnResizePolicy = SmartResize.POLICY
column("Event", AudioFileModel::eventNameProperty)
.weigthedWidth(1.0)
.weightedWidth(1.0)
column("Animation name", AudioFileModel::animationNameProperty)
.weigthedWidth(1.0)
.weightedWidth(1.0)
column("Audio file", AudioFileModel::displayFilePathProperty)
.weigthedWidth(1.0)
.weightedWidth(1.0)
column("Dialog", AudioFileModel::dialogProperty).apply {
weigthedWidth(3.0)
weightedWidth(3.0)
// Make dialog column wrap
setCellFactory { tableColumn ->
return@setCellFactory TableCell<AudioFileModel, String>().also { cell ->
@ -138,7 +138,7 @@ class MainView : View() {
}
}
column("Status", AudioFileModel::audioFileStateProperty).apply {
weigthedWidth(1.0)
weightedWidth(1.0)
setCellFactory {
return@setCellFactory object : TableCell<AudioFileModel, AudioFileState>() {
override fun updateItem(state: AudioFileState?, empty: Boolean) {
@ -176,7 +176,7 @@ class MainView : View() {
}
}
column("", AudioFileModel::actionLabelProperty).apply {
weigthedWidth(1.0)
weightedWidth(1.0)
// Show button
setCellFactory {
return@setCellFactory object : TableCell<AudioFileModel, String>() {

View File

@ -1,9 +1,6 @@
package com.rhubarb_lip_sync.rhubarb_for_spine
import com.beust.klaxon.JsonObject
import com.beust.klaxon.array
import com.beust.klaxon.double
import com.beust.klaxon.string
import com.beust.klaxon.Parser as JsonParser
import org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS
import java.io.*
@ -78,7 +75,7 @@ class RhubarbTask(
}
}
private val jsonParser = JsonParser()
private val jsonParser = JsonParser.default()
private fun parseJsonObject(jsonString: String): JsonObject {
return jsonParser.parse(StringReader(jsonString)) as JsonObject
}

View File

@ -17,7 +17,7 @@ class SpineJson(private val filePath: Path) {
throw EndUserException("File '$filePath' does not exist.")
}
try {
json = Parser().parse(filePath.toString()) as JsonObject
json = Parser.default().parse(filePath.toString()) as JsonObject
} catch (e: Exception) {
throw EndUserException("Wrong file format. This is not a valid JSON file.")
}