Skip to content

Update JavaFX version to 14 #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 11.0.8
java-version: 14.0.2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 11.0.8
java-version: 14.0.2
- name: Build with Gradle
run: ./gradlew deploy
17 changes: 11 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'application'
id 'org.beryx.jlink' version '2.15.1'
id 'org.beryx.jlink' version '2.21.4'
id 'org.openjfx.javafxplugin' version '0.0.8'
}

Expand All @@ -10,16 +10,21 @@ import org.gradle.internal.jvm.Jvm
group 'template'
version '1.0-SNAPSHOT'

sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 14
targetCompatibility = 14

application {
mainModule = myMainModuleName
mainClass = myMainClassName
}

repositories {
mavenCentral()
}

mainClassName = mainModule + "/" + mainClass

jlink {
moduleName = application.mainModule
mainClass = application.mainClass
javaHome.set(Jvm.current().getJavaHome().getAbsolutePath())
launcher {
jvmArgs += rootProject.jvmArgs
Expand All @@ -31,7 +36,7 @@ run {
}

javafx {
version = "11"
version = "14"
modules = [
'javafx.controls',
'javafx.fxml',
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ def currentJvm = Jvm.current()
println "Java version: ${currentJvm.getJavaVersion()}"
println "Java home: ${currentJvm.getJavaHome()}"

if (currentJvm.getJavaVersion() != JavaVersion.VERSION_11)
throw new GradleException("Java version should be 11")
if (currentJvm.getJavaVersion() != JavaVersion.VERSION_14)
throw new GradleException("Java version should be 14")

ext.mainClass = "template.Main"
ext.mainModule = "template"
ext.myMainClassName = "template.Main"
ext.myMainModuleName = "template"
ext.jvmArgs = [

]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions launcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ model {
// Define a preprocessor macro for every binary
cppCompiler.define "NDEBUG"

def mainClassName = mainClass.replaceAll("\\.", "/")
def jvmArgsArrayMacro = "{\"--module-path=.\",\"--add-modules=$mainModule\""
def mainClassName = myMainClassName.replaceAll("\\.", "/")
def jvmArgsArrayMacro = "{\"--module-path=.\",\"--add-modules=$myMainModuleName\""
for (arg in rootProject.jvmArgs) {
jvmArgsArrayMacro += ",\"$arg\""
}
Expand Down