-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target Java 8 in Java 9 build #4037
Target Java 8 in Java 9 build #4037
Conversation
apply from: "${rootProject.projectDir}/gradle/scripts/release.gradle" | ||
apply from: "${rootProject.projectDir}/gradle/scripts/remote-lib.gradle" | ||
apply from: "${rootProject.projectDir}/gradle/scripts/version.gradle" | ||
|
||
group = 'triplea' | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a regression from when I was consolidating the buildscripts. The sourceCompatibility
and targetCompatibility
properties must be set after the java
plugin is applied, otherwise they will be overwritten with the version of the running JVM.
testCompile project(':test-common') | ||
testCompile "org.sonatype.goodies:goodies-prefs:$sonatypeGoodiesPrefsVersion" | ||
testCompile "org.testfx:testfx-core:$testFxVersion" | ||
testCompile "org.testfx:testfx-junit5:$testFxVersion" | ||
|
||
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) { | ||
testCompileOnly remoteLib(javaFxRuntimeUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the testCompileOnly
configuration does not inherit from the compileOnly
configuration. Research shows this appears to be a design decision by the Gradle maintainers (to be different than how Maven works with its provideCompile
configuration).
|
||
def remoteLibsDir = file('.remote-libs') | ||
|
||
ext.remoteLib = { url -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I had to re-introduce this functionality in order to download the JavaFX dependency from the assets
repo. To keep things clean, I extracted all the related code into this standalone script.
Overview
Fixes #2803.
Functional Changes
--release 8
to the compiler in the Java 9 build to ensure it links against the Java 8 runtime.--release
flag only uses the public JDK, it does not include any extensions that may be installed, and JavaFX is considered an extension to Java 8. Therefore, we have to bring the JavaFX 8 runtime in as a dependency. This dependency is not available publicly, so the version from the latest JDK 8 was added to ourassets
repo (Add JavaFX 8 library assets#21).Manual Testing Performed
Ran a local build using Java 9 to produce the
game-headed
artifacts. Ran the portable build artifact under Java 8 and verified I could connect to the lobby (the original problem reported in #2801). Also verified the JavaFX client ran correctly from both Java 8 and Java 9.