From b79cb258dca32c70a340208ff6b0de5fceaeaf04 Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 13:07:48 -0400 Subject: [PATCH 1/8] Java 11 Required --- .classpath | 50 ++++++++++++++-------------- .settings/org.eclipse.jdt.core.prefs | 6 ++-- build.gradle | 2 ++ 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.classpath b/.classpath index 78b60bd14..c00ed9ca4 100644 --- a/.classpath +++ b/.classpath @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 80a5df502..e716c3326 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,14 +1,14 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.compliance=11 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/build.gradle b/build.gradle index a75704f7f..d8ce89f80 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,8 @@ apply plugin: 'jacoco' archivesBaseName = "litiengine" version = "v0.4.19-alpha" +sourceCompatibility = "11" +targetCompatibility = "11" sourceSets { main.java.srcDir "src" From aefd5262bb18ecd4bb05cda8c1692b12b707b62e Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 13:14:54 -0400 Subject: [PATCH 2/8] Add JavaFX to classpath --- .travis.yml | 4 +++- build-maven.gradle | 9 +++++++++ build.gradle | 11 ++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77e3b34e9..46fbbfe88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ before_install: - chmod +x gradlew - sudo apt-get -y install at-spi2-core -jdk: openjdk11 +jdk: + - openjdk11 + - oraclejdk9 git: depth: false diff --git a/build-maven.gradle b/build-maven.gradle index 4c10a9e2e..d33a19c14 100644 --- a/build-maven.gradle +++ b/build-maven.gradle @@ -1,6 +1,9 @@ apply plugin: 'java-library' apply plugin: 'maven-publish' apply plugin: 'signing' +if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { + apply plugin: 'org.openjfx.javafxplugin' +} sourceSets { main.java.srcDir "src" @@ -14,6 +17,11 @@ repositories { mavenCentral() } +javafx { + version = "11.0.2" + modules = ['javafx.media', 'javafx.swing'] +} + dependencies { implementation 'net.java.jinput:jinput:2.0.9' implementation 'net.java.jinput:jinput:2.0.9:natives-all' @@ -36,6 +44,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.1' testImplementation 'org.mockito:mockito-core:2.25.1' + } test { diff --git a/build.gradle b/build.gradle index d8ce89f80..aaa1ca75f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,11 +4,20 @@ buildscript { } } - plugins { +plugins { id 'com.stehno.natives' version '0.3.1' id 'org.sonarqube' version '2.8' } +if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { + apply plugin: 'org.openjfx.javafxplugin' +} + +javafx { + version = "11.0.2" + modules = ['javafx.media', 'javafx.swing'] +} + natives { configurations = ['runtimeClasspath'] outputDir = 'libs' From 8d7cc243397ba394d505aaa1699e3aaa6ef23b09 Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 15:51:30 -0400 Subject: [PATCH 3/8] Figured out how to make JavaFX compile with jdk8 and jdk11 --- .classpath | 2 +- .settings/org.eclipse.jdt.core.prefs | 2 +- build-maven.gradle | 20 +++++++++++++++----- build.gradle | 18 +++++++++++------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/.classpath b/.classpath index c00ed9ca4..2bf1919a4 100644 --- a/.classpath +++ b/.classpath @@ -19,7 +19,7 @@ - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index e716c3326..daecd4083 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,6 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=11 org.eclipse.jdt.core.compiler.debug.lineNumber=generate diff --git a/build-maven.gradle b/build-maven.gradle index d33a19c14..4c0d2ae35 100644 --- a/build-maven.gradle +++ b/build-maven.gradle @@ -1,8 +1,21 @@ +buildscript { + dependencies { + if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { + classpath "org.openjfx:javafx-plugin:0.0.8" + } + } +} + apply plugin: 'java-library' apply plugin: 'maven-publish' apply plugin: 'signing' + if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { apply plugin: 'org.openjfx.javafxplugin' + javafx { + version = "11.0.2" + modules = ['javafx.media', 'javafx.swing'] + } } sourceSets { @@ -17,11 +30,6 @@ repositories { mavenCentral() } -javafx { - version = "11.0.2" - modules = ['javafx.media', 'javafx.swing'] -} - dependencies { implementation 'net.java.jinput:jinput:2.0.9' implementation 'net.java.jinput:jinput:2.0.9:natives-all' @@ -102,6 +110,8 @@ tasks.withType(JavaCompile) { group = "de.gurkenlabs" archivesBaseName = "litiengine" version = "0.4.19" +sourceCompatibility = "8" +targetCompatibility = "8" publishing { publications { diff --git a/build.gradle b/build.gradle index aaa1ca75f..497557768 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,11 @@ buildscript { repositories { mavenCentral() } + dependencies { + if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { + classpath "org.openjfx:javafx-plugin:0.0.8" + } + } } plugins { @@ -11,11 +16,10 @@ plugins { if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) { apply plugin: 'org.openjfx.javafxplugin' -} - -javafx { - version = "11.0.2" - modules = ['javafx.media', 'javafx.swing'] + javafx { + version = "11.0.2" + modules = ['javafx.media', 'javafx.swing'] + } } natives { @@ -28,8 +32,8 @@ apply plugin: 'jacoco' archivesBaseName = "litiengine" version = "v0.4.19-alpha" -sourceCompatibility = "11" -targetCompatibility = "11" +sourceCompatibility = "8" +targetCompatibility = "8" sourceSets { main.java.srcDir "src" From 74723cf70709bda07548fee679572e4bdd5ffece Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 15:56:19 -0400 Subject: [PATCH 4/8] Fix javadoc --- src/de/gurkenlabs/litiengine/resources/Resources.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/gurkenlabs/litiengine/resources/Resources.java b/src/de/gurkenlabs/litiengine/resources/Resources.java index bb4bae00b..ee3324297 100644 --- a/src/de/gurkenlabs/litiengine/resources/Resources.java +++ b/src/de/gurkenlabs/litiengine/resources/Resources.java @@ -156,7 +156,7 @@ public static Blueprints blueprints() { * * @return The VideoManager resource container. * - * @see VideoManager + * @see de.gurkenlabs.litiengine.video.VideoManager */ public static Videos videos() { return videos; From 3dbc130a375f9cab65f59255c86082eabc27de95 Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 17:01:07 -0400 Subject: [PATCH 5/8] Travis needs OpenJFX 8 to compile for Java 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 46fbbfe88..529ddb3b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ install: true before_install: - chmod +x gradlew - sudo apt-get -y install at-spi2-core - + - sudo apt-get -y install libopenjfx-java jdk: - openjdk11 - oraclejdk9 From 7cf6dbf89c0eb960aa713126c0462110cdc396d1 Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 17:08:34 -0400 Subject: [PATCH 6/8] OpenJDK not OracleJDK --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 529ddb3b9..e7bd6e7d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_install: - sudo apt-get -y install libopenjfx-java jdk: - openjdk11 - - oraclejdk9 + - openjdk8 git: depth: false From a965c2760c8d76d4925ba25091173834b3e0b67b Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 17:15:05 -0400 Subject: [PATCH 7/8] openjfx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7bd6e7d1..45b2b5661 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ install: true before_install: - chmod +x gradlew - sudo apt-get -y install at-spi2-core - - sudo apt-get -y install libopenjfx-java + - sudo apt-get -y install openjfx jdk: - openjdk11 - openjdk8 From e1db74b16b1c7402d3a12e5a65060cbc2b30290d Mon Sep 17 00:00:00 2001 From: Gamebuster19901 Date: Sun, 29 Mar 2020 17:48:12 -0400 Subject: [PATCH 8/8] Fix black screen --- src/de/gurkenlabs/litiengine/video/VideoManagerImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/de/gurkenlabs/litiengine/video/VideoManagerImpl.java b/src/de/gurkenlabs/litiengine/video/VideoManagerImpl.java index 5947019de..e864dd7ed 100644 --- a/src/de/gurkenlabs/litiengine/video/VideoManagerImpl.java +++ b/src/de/gurkenlabs/litiengine/video/VideoManagerImpl.java @@ -61,6 +61,7 @@ private synchronized void setMedia(Media media) { Scene scene = new Scene(root, media.getWidth(), media.getHeight()); mediaView.autosize(); panel.setScene(scene); + mediaView.getMediaPlayer().setOnReady(() -> panel.setSize(media.getWidth(), media.getHeight())); }); }