Skip to content

Commit

Permalink
build.gradle: add javafx runtime dependency
Browse files Browse the repository at this point in the history
JavaFX is not distributed with Oracle JDK any more from JDK11 onwards [1].
Our code uses javafx as our client platform. So it is unable to be compiled
in JDK11 anymore.

As we are moving to JDK11, let’s add javafx runtime dependency to gradle.

Meanwhile, the dependency provided are platform specific. Let’s use the
SystemUtils api provided by Apache [2] to specify the version of javafx
dependency.

[1]https://blogs.oracle.com/java-platform-group/the-future-of-javafx-and-other-java-client-roadmap-updates
[2]http://commons.apache.org/proper/commons-lang/javadocs/api-release/index.html
  • Loading branch information
fzdy1914 committed Mar 16, 2019
1 parent 18d0cab commit 3cb5cbb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// For more details take a look at the Java Quickstart chapter in the Gradle
// user guide available at http://gradle.org/docs/5.2.1/userguide/tutorial_java_projects.html

import org.apache.commons.lang.SystemUtils
import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
Expand Down Expand Up @@ -41,10 +42,28 @@ test {
useJUnitPlatform()
}

def platform
if (SystemUtils.IS_OS_WINDOWS) {
platform = 'win'
} else if (SystemUtils.IS_OS_LINUX) {
platform = 'linux'
} else if (SystemUtils.IS_OS_MAC) {
platform = 'mac'
}

dependencies {
String testFxVersion = '4.0.15-alpha'
String jUnitVersion = '5.1.0'
String javafxVersion = '11'

implementation group: 'org.openjfx', name: 'javafx-base', version: javafxVersion, classifier: platform
implementation group: 'org.openjfx', name: 'javafx-controls', version: javafxVersion, classifier: platform
implementation group: 'org.openjfx', name: 'javafx-fxml', version: javafxVersion, classifier: platform
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javafxVersion, classifier: platform
implementation group: 'org.openjfx', name: 'javafx-media', version: javafxVersion, classifier: platform
implementation group: 'org.openjfx', name: 'javafx-web', version: javafxVersion, classifier: platform

implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4'

Expand Down

0 comments on commit 3cb5cbb

Please sign in to comment.