Jdk 11 Build Support

accellbaker
Trevor Flynn 6 years ago committed by Riccardo Balbo
parent 74588d96f3
commit ad2ba95e99
  1. 3
      .gitignore
  2. 2
      .travis.yml
  3. 4
      common.gradle
  4. 18
      jme3-android-native/decode.gradle
  5. 17
      jme3-android-native/openalsoft.gradle
  6. 2
      jme3-bullet-native/build.gradle
  7. 59
      jme3-bullet/build.gradle
  8. 16
      jme3-networking/src/main/java/com/jme3/network/service/rmi/MethodInfo.java
  9. 6
      jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java

3
.gitignore vendored

@ -19,6 +19,8 @@
*.jnilib *.jnilib
*.dylib *.dylib
*.iml *.iml
*.class
*.jtxt
.gradletasknamecache .gradletasknamecache
.DS_Store .DS_Store
/jme3-core/src/main/resources/com/jme3/system/version.properties /jme3-core/src/main/resources/com/jme3/system/version.properties
@ -47,3 +49,4 @@
!/jme3-vr/src/main/resources/**/*.dll !/jme3-vr/src/main/resources/**/*.dll
!/jme3-vr/src/main/resources/**/*.pdb !/jme3-vr/src/main/resources/**/*.pdb
/buildMaven.bat /buildMaven.bat

@ -14,7 +14,7 @@ matrix:
jdk: oraclejdk8 jdk: oraclejdk8
env: UPLOAD=true UPLOAD_NATIVE=true env: UPLOAD=true UPLOAD_NATIVE=true
- os: linux - os: linux
jdk: openjdk7 jdk: openjdk11
dist: precise dist: precise
- os: osx - os: osx
osx_image: xcode9.3 osx_image: xcode9.3

@ -8,7 +8,7 @@ apply plugin: 'maven'
group = 'org.jmonkeyengine' group = 'org.jmonkeyengine'
version = jmePomVersion version = jmePomVersion
sourceCompatibility = '1.7' sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories { repositories {
@ -24,7 +24,7 @@ repositories {
dependencies { dependencies {
// Adding dependencies here will add the dependencies to each subproject. // Adding dependencies here will add the dependencies to each subproject.
testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.0.28-beta' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19'
testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10' testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10'
} }

@ -44,13 +44,19 @@ task copyTremorFiles(type: Copy) {
into outputDir into outputDir
} }
// Generate headers via javah // Generate headers via javac -h
task generateJavahHeaders(type: Exec) { task generateJavahHeaders(type: Exec) {
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah') def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args '-d', decodeSourceDir def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args '-classpath', project.projectClassPath def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args "com.jme3.audio.plugins.NativeVorbisFile" def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args "com.jme3.texture.plugins.AndroidNativeImageLoader" def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\""
new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/"))
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac')
args '-h', decodeSourceDir
args "@$projectDir/java_classes.jtxt"
} }
// Copy jME Android native files to jni directory // Copy jME Android native files to jni directory

@ -73,12 +73,17 @@ task copyJmeOpenALSoft(type: Copy, dependsOn:copyOpenALSoft) {
} }
task generateOpenAlSoftHeaders(type:Exec, dependsOn: copyJmeOpenALSoft) { task generateOpenAlSoftHeaders(type:Exec, dependsOn: copyJmeOpenALSoft) {
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah') def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args '-d', openalsoftJmeAndroidPath def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args '-classpath', project.projectClassPath def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args "com.jme3.audio.android.AndroidAL" def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args "com.jme3.audio.android.AndroidALC" def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
args "com.jme3.audio.android.AndroidEFX" def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\""
new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/"))
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac')
args '-h', openalsoftJmeAndroidPath
args "@$projectDir/java_classes.jtxt"
} }
task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders) { task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders) {

@ -220,7 +220,7 @@ task unzipBulletIfNeeded {
} }
unzipBulletIfNeeded.dependsOn { unzipBulletIfNeeded.dependsOn {
if (buildNativeProjects == "true" && !file(bulletFolder).isDirectory()) { if (buildNativeProjects == "true") {
unzipBullet unzipBullet
} }
} }

@ -17,52 +17,23 @@ dependencies {
} }
task generateNativeHeaders(type: Exec, dependsOn: classes) { task generateNativeHeaders(type: Exec, dependsOn: classes) {
def classes = " \ def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
com.jme3.bullet.PhysicsSpace, \ def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
\ def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
com.jme3.bullet.collision.PhysicsCollisionEvent, \ def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
com.jme3.bullet.collision.PhysicsCollisionObject,\ def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
com.jme3.bullet.objects.PhysicsCharacter, \ def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files
com.jme3.bullet.objects.PhysicsGhostObject, \
com.jme3.bullet.objects.PhysicsRigidBody, \
com.jme3.bullet.objects.PhysicsVehicle, \
com.jme3.bullet.objects.VehicleWheel, \
com.jme3.bullet.objects.infos.RigidBodyMotionState, \
\
com.jme3.bullet.collision.shapes.CollisionShape, \
com.jme3.bullet.collision.shapes.BoxCollisionShape, \
com.jme3.bullet.collision.shapes.CapsuleCollisionShape, \
com.jme3.bullet.collision.shapes.CompoundCollisionShape, \
com.jme3.bullet.collision.shapes.ConeCollisionShape, \
com.jme3.bullet.collision.shapes.CylinderCollisionShape, \
com.jme3.bullet.collision.shapes.GImpactCollisionShape, \
com.jme3.bullet.collision.shapes.HeightfieldCollisionShape, \
com.jme3.bullet.collision.shapes.HullCollisionShape, \
com.jme3.bullet.collision.shapes.MeshCollisionShape, \
com.jme3.bullet.collision.shapes.PlaneCollisionShape, \
com.jme3.bullet.collision.shapes.SimplexCollisionShape, \
com.jme3.bullet.collision.shapes.SphereCollisionShape, \
\
com.jme3.bullet.joints.PhysicsJoint, \
com.jme3.bullet.joints.ConeJoint, \
com.jme3.bullet.joints.HingeJoint, \
com.jme3.bullet.joints.Point2PointJoint, \
com.jme3.bullet.joints.SixDofJoint, \
com.jme3.bullet.joints.SixDofSpringJoint, \
com.jme3.bullet.joints.SliderJoint, \
com.jme3.bullet.joints.motors.RotationalLimitMotor, \
com.jme3.bullet.joints.motors.TranslationalLimitMotor, \
\
com.jme3.bullet.util.NativeMeshUtil, \
com.jme3.bullet.util.DebugShapeFactory"
def classpath = sourceSets.main.runtimeClasspath.asPath def classpath = sourceSets.main.runtimeClasspath.asPath
def nativeIncludes = new File(project(":jme3-bullet-native").projectDir, "src/native/cpp") def nativeIncludes = new File(project(":jme3-bullet-native").projectDir, "src/native/cpp")
def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\""
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah') new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/"))
args "-d", nativeIncludes //project.logger.lifecycle("Files: " + files0.size())
args "-classpath", classpath //project.logger.lifecycle("Files: " + files1.size())
args classes.split(",").collect { it.trim() } executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac')
args "-h", nativeIncludes
//args "-classpath", classpath
args "@$projectDir/java_classes.jtxt"
//args classes.split(",").collect { it.trim() }
} }
assemble.dependsOn(generateNativeHeaders) assemble.dependsOn(generateNativeHeaders)

@ -33,9 +33,9 @@
package com.jme3.network.service.rmi; package com.jme3.network.service.rmi;
import com.jme3.network.serializing.Serializable; import com.jme3.network.serializing.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import javax.jws.Oneway;
/** /**
@ -102,12 +102,18 @@ public final class MethodInfo {
} }
public static CallType getCallType( Method m ) { public static CallType getCallType( Method m ) {
if( m.getReturnType() != Void.TYPE ) if( m.getReturnType() != Void.TYPE ) {
return CallType.Synchronous; return CallType.Synchronous;
if( m.getAnnotation(Oneway.class) != null ) }
return CallType.Asynchronous; if( m.getAnnotation(Asynchronous.class) == null ) {
if( m.getAnnotation(Asynchronous.class) == null )
return CallType.Synchronous; return CallType.Synchronous;
}
for (Annotation annotation : m.getAnnotations()) {
Class<? extends Annotation> type = annotation.annotationType();
if (type.getName().equals("javax.jws.Oneway")) {
return CallType.Asynchronous;
}
}
Asynchronous async = m.getAnnotation(Asynchronous.class); Asynchronous async = m.getAnnotation(Asynchronous.class);
return async.reliable() ? CallType.Asynchronous : CallType.Unreliable; return async.reliable() ? CallType.Asynchronous : CallType.Unreliable;

@ -16,8 +16,6 @@ import com.jme3.texture.Texture;
import com.jme3.texture.Texture2D; import com.jme3.texture.Texture2D;
import com.jme3.util.IntMap; import com.jme3.util.IntMap;
import com.jme3.util.mikktspace.MikktspaceTangentGenerator; import com.jme3.util.mikktspace.MikktspaceTangentGenerator;
import javax.xml.bind.DatatypeConverter;
import java.io.*; import java.io.*;
import java.nio.Buffer; import java.nio.Buffer;
import java.nio.FloatBuffer; import java.nio.FloatBuffer;
@ -543,7 +541,7 @@ public class GltfLoader implements AssetLoader {
if (uri != null) { if (uri != null) {
if (uri.startsWith("data:")) { if (uri.startsWith("data:")) {
//base 64 embed data //base 64 embed data
data = DatatypeConverter.parseBase64Binary(uri.substring(uri.indexOf(",") + 1)); data = Base64.getDecoder().decode(uri.substring(uri.indexOf(",") + 1));
} else { } else {
//external file let's load it //external file let's load it
if (!uri.endsWith(".bin")) { if (!uri.endsWith(".bin")) {
@ -714,7 +712,7 @@ public class GltfLoader implements AssetLoader {
} else if (uri.startsWith("data:")) { } else if (uri.startsWith("data:")) {
//base64 encoded image //base64 encoded image
String[] uriInfo = uri.split(","); String[] uriInfo = uri.split(",");
byte[] data = DatatypeConverter.parseBase64Binary(uriInfo[1]); byte[] data = Base64.getDecoder().decode(uriInfo[1]);
String headerInfo = uriInfo[0].split(";")[0]; String headerInfo = uriInfo[0].split(";")[0];
String extension = headerInfo.split("/")[1]; String extension = headerInfo.split("/")[1];
TextureKey key = new TextureKey("image" + sourceIndex + "." + extension, flip); TextureKey key = new TextureKey("image" + sourceIndex + "." + extension, flip);

Loading…
Cancel
Save