After tweeting my blog posts on Twitter, I got a reply from the cofounder of Gluon no less (Eugene Ryzhikov) who suggested I take a look at the javafx-gradle-plugin. I’m glad I did – it has cleaned up my gradle file nicely so that it looks less abnormal.
I think I did it right.
Old Gradle Dependencies
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile name: "javafx.fxml" // WEIRD
compile name: "javafx.controls" // WEIRD
compile name: "javafx.base" // WEIRD
compile name: "javafx.graphics" // WEIRD
compile "com.google.guava:guava:27.1-jre"
testCompile "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION"
testCompile "org.assertj:assertj-core:3.11.1"
testCompile "org.testfx:testfx-core:4.0.15-alpha"
testCompile "org.testfx:testfx-junit:4.0.15-alpha"
}
New Gradle Dependencies
javafx {
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile "com.google.guava:guava:27.1-jre"
// WEIRDNESS GONE
testCompile "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION"
testCompile "org.assertj:assertj-core:3.11.1"
testCompile "org.testfx:testfx-core:4.0.15-alpha"
testCompile "org.testfx:testfx-junit:4.0.15-alpha"
}
The full gradle file is here.