2019-07-11 19:08:10 +00:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
import java.io.File
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
kotlin("jvm") version "1.3.41"
|
2021-06-18 15:58:03 +00:00
|
|
|
id("org.openjfx.javafxplugin") version "0.0.10"
|
2019-07-11 19:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fun getVersion(): String {
|
|
|
|
// Dynamically read version from CMake file
|
|
|
|
val file = File(rootDir.parentFile.parentFile, "appInfo.cmake")
|
|
|
|
val text = file.readText()
|
|
|
|
val major = Regex("""appVersionMajor\s+(\d+)""").find(text)!!.groupValues[1]
|
|
|
|
val minor = Regex("""appVersionMinor\s+(\d+)""").find(text)!!.groupValues[1]
|
|
|
|
val patch = Regex("""appVersionPatch\s+(\d+)""").find(text)!!.groupValues[1]
|
|
|
|
val suffix = Regex("""appVersionSuffix\s+"(.*?)"""").find(text)!!.groupValues[1]
|
|
|
|
return "$major.$minor.$patch$suffix"
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "com.rhubarb_lip_sync"
|
|
|
|
version = getVersion()
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
jcenter()
|
2021-06-18 15:58:03 +00:00
|
|
|
maven("https://oss.sonatype.org/content/repositories/snapshots")
|
2019-07-11 19:08:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("stdlib-jdk8"))
|
|
|
|
implementation("com.beust:klaxon:5.0.1")
|
|
|
|
implementation("org.apache.commons:commons-lang3:3.9")
|
2021-06-18 15:58:03 +00:00
|
|
|
implementation("no.tornado:tornadofx:2.0.0-SNAPSHOT")
|
2019-07-17 19:44:25 +00:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.5.0")
|
|
|
|
testCompile("org.assertj:assertj-core:3.11.1")
|
2019-07-11 19:08:10 +00:00
|
|
|
}
|
|
|
|
|
2021-06-18 15:58:03 +00:00
|
|
|
javafx {
|
|
|
|
version = "15.0.1"
|
|
|
|
modules("javafx.controls")
|
|
|
|
}
|
|
|
|
|
2019-07-11 19:08:10 +00:00
|
|
|
tasks.withType<KotlinCompile> {
|
|
|
|
kotlinOptions.jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
|
2019-07-17 19:44:25 +00:00
|
|
|
tasks.test {
|
|
|
|
useJUnitPlatform()
|
2019-07-11 19:08:10 +00:00
|
|
|
}
|
|
|
|
|
2019-07-21 08:26:41 +00:00
|
|
|
tasks.withType<Jar> {
|
2019-07-17 19:44:25 +00:00
|
|
|
manifest {
|
|
|
|
attributes("Main-Class" to "com.rhubarb_lip_sync.rhubarb_for_spine.MainKt")
|
|
|
|
}
|
2019-07-21 08:26:41 +00:00
|
|
|
|
|
|
|
from(configurations.compileClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
2019-07-11 19:08:10 +00:00
|
|
|
}
|