Skip to content

Commit

Permalink
Add JavaFX to classpath (#3)
Browse files Browse the repository at this point in the history
* Add JavaFX to classpath

* Figured out how to make JavaFX compile with jdk8 and jdk11

* Travis needs OpenJFX 8 to compile for Java 8
  • Loading branch information
Gamebuster19901 committed Mar 29, 2020
1 parent fb48a25 commit ec99a8a
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 31 deletions.
50 changes: 25 additions & 25 deletions .classpath
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="tests">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="tests">
<attributes>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
4 changes: 2 additions & 2 deletions .settings/org.eclipse.jdt.core.prefs
Expand Up @@ -2,13 +2,13 @@ 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.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
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Expand Up @@ -3,8 +3,10 @@ install: true
before_install:
- chmod +x gradlew
- sudo apt-get -y install at-spi2-core

jdk: openjdk11
- sudo apt-get -y install openjfx
jdk:
- openjdk11
- openjdk8

git:
depth: false
Expand Down
19 changes: 19 additions & 0 deletions build-maven.gradle
@@ -1,7 +1,23 @@
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 {
main.java.srcDir "src"
main.resources.srcDir "resources"
Expand Down Expand Up @@ -36,6 +52,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 {
Expand Down Expand Up @@ -93,6 +110,8 @@ tasks.withType(JavaCompile) {
group = "de.gurkenlabs"
archivesBaseName = "litiengine"
version = "0.4.19"
sourceCompatibility = "8"
targetCompatibility = "8"

publishing {
publications {
Expand Down
17 changes: 16 additions & 1 deletion build.gradle
Expand Up @@ -2,13 +2,26 @@ buildscript {
repositories {
mavenCentral()
}
dependencies {
if(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
classpath "org.openjfx:javafx-plugin:0.0.8"
}
}
}

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'
Expand All @@ -19,6 +32,8 @@ apply plugin: 'jacoco'

archivesBaseName = "litiengine"
version = "v0.4.19-alpha"
sourceCompatibility = "8"
targetCompatibility = "8"

sourceSets {
main.java.srcDir "src"
Expand Down
2 changes: 1 addition & 1 deletion src/de/gurkenlabs/litiengine/resources/Resources.java
Expand Up @@ -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;
Expand Down

0 comments on commit ec99a8a

Please sign in to comment.