diff options
author | Sven Gothel <[email protected]> | 2012-06-26 10:39:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-26 10:39:23 +0200 |
commit | 9a71703904ebfec343fb2c7266343d37a2e4c3db (patch) | |
tree | 7ca65a063f218064059743ca5cda7744cfc75c20 /make | |
parent | 2a10f604b65f12ae5e8987bfa73cffcc1d5f796e (diff) |
Implement Bug #598 - JOGL ALL JAR File Change incl. it's Native Jar URL Derivation
+++
JNILibLoaderBase.addNativeJarLibs(..): Add API doc
JNILibLoaderBase:
"addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)" ->
"addNativeJarLibs(Class<?>[] classesFromJavaJars, String singleJarMarker, String[] stripBasenameSuffixes)"
Derive the 'all' (1st choice) native JAR URL solely on the given class's JAR URL.
Examples:
JOCL:
// only: jocl.jar -> jocl-natives-'os.and.arch'.jar
addNativeJarLibs(new Class<?>[] { JOCLJNILibLoader.class }, null, null );
JOGL:
final ClassLoader cl = GLProfile.class.getClassLoader();
// either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar
// or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar,
// jogl-core.jar -> jogl-natives-<os.and.arch>.jar,
// (newt-core.jar -> newt-natives-<os.and.arch>.jar)? (if available)
final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null };
if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) {
classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl);
}
JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core" } );
Efficiency / Performance:
- Reduced JAR URL lookup calls JarUtil.getJarURL(..) - JNILibLoaderBase, Platform, JarUtil
- Attempt loading Jar files (native, class, ..) only once - TempJarCache
Code Cleanup (IOUtil, JarUtil, :
- IOException if not found
- IllegalArgumentException if null argument
+++
jogamp.android-launcher.jar -> jogamp-android-launcher.jar
+++
Diffstat (limited to 'make')
-rw-r--r-- | make/build-test.xml | 2 | ||||
-rw-r--r-- | make/build.xml | 20 | ||||
-rwxr-xr-x | make/scripts/adb-install-all-armv7.sh | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/make/build-test.xml b/make/build-test.xml index 7540c1c..a5417b6 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -86,7 +86,7 @@ </path> <property name="junit.run.jars" value="${junit.jar}${path.separator}${ant.jar}${path.separator}${TestJarsInJar.jar}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/> <property name="junit.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${gluegen.root}/make/lib/TestJarsInJar.jar${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/> - <property name="junit.run.remote.apks" value="${gluegen.root}/${rootrel.build}/jogamp.android-launcher.apk${path.separator}${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt-android-${android.abi}.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/> + <property name="junit.run.remote.apks" value="${gluegen.root}/${rootrel.build}/jogamp-android-launcher.apk${path.separator}${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt-android-${android.abi}.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/> <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> diff --git a/make/build.xml b/make/build.xml index 9b4e316..671e3c3 100644 --- a/make/build.xml +++ b/make/build.xml @@ -141,7 +141,7 @@ <property name="archive" value="${build}/${archive.name}" /> <!-- the launcher is compiled and packaged explicit - if android --> - <property name="jogamp.android-launcher.classes" value="jogamp/android/launcher/**"/> + <property name="jogamp-android-launcher.classes" value="jogamp/android/launcher/**"/> <!-- optional android classes - if android --> <property name="java.part.android" value="jogamp/common/os/android/**"/> @@ -150,7 +150,7 @@ <property name="gluegen-rt.classes" value="com/jogamp/gluegen/runtime/**"/> <property name="jogamp.common.classes" value="com/jogamp/common/** jogamp/common/**"/> - <property name="gluegen.excludes.all" value="${gluegen.excludes.nsig} ${jogamp.android-launcher.classes}" /> + <property name="gluegen.excludes.all" value="${gluegen.excludes.nsig} ${jogamp-android-launcher.classes}" /> </target> @@ -709,7 +709,7 @@ <jar destfile="${build}/gluegen.jar" manifest="${build}/Manifest.temp"> <fileset dir="${classes}"> <include name="**/*.class" /> - <exclude name="${jogamp.android-launcher.classes}" /> + <exclude name="${jogamp-android-launcher.classes}" /> <exclude name="${java.part.android}" /> </fileset> <fileset dir="resources/assets"> @@ -734,7 +734,7 @@ <include name="com/jogamp/gluegen/runtime/*.class" /> <include name="com/jogamp/common/**" /> <include name="jogamp/common/**" /> - <exclude name="${jogamp.android-launcher.classes}" /> + <exclude name="${jogamp-android-launcher.classes}" /> <exclude name="${java.part.android}" /> </fileset> <fileset dir="resources/assets"> @@ -793,7 +793,7 @@ <include name="com/jogamp/gluegen/runtime/*.class" /> <include name="com/jogamp/common/**" /> <include name="jogamp/common/**" /> - <exclude name="${jogamp.android-launcher.classes}" /> + <exclude name="${jogamp-android-launcher.classes}" /> </fileset> <fileset dir="resources/assets"> <include name="**" /> @@ -812,14 +812,14 @@ <srcfiles dir= "." includes="*.xml"/> <srcfiles dir= "resources/android" includes="**/*.xml"/> <srcfiles dir= "${src.java}/jogamp/android/launcher" includes="**"/> - <mapper type="merge" to="${build}/jogamp.android-launcher.jar"/> + <mapper type="merge" to="${build}/jogamp-android-launcher.jar"/> </uptodate> </target> <target name="android-launcher.build" depends="gluegen.cpptasks.detect.os,gluegen.build.check.android-launcher" if="isAndroid" unless="gluegen.build.skip.android-launcher"> <javac destdir="${classes}" includeAntRuntime="false" - includes="${jogamp.android-launcher.classes}" + includes="${jogamp-android-launcher.classes}" excludes="${jogamp.common.classes}" memoryMaximumSize="${javac.memorymax}" encoding="UTF-8" @@ -842,16 +842,16 @@ </filterset> </copy> - <jar destfile="${build}/jogamp.android-launcher.jar" manifest="${build}/Manifest-android-launcher.temp"> + <jar destfile="${build}/jogamp-android-launcher.jar" manifest="${build}/Manifest-android-launcher.temp"> <fileset dir="${classes}"> - <include name="${jogamp.android-launcher.classes}" /> + <include name="${jogamp-android-launcher.classes}" /> </fileset> </jar> <aapt.signed assetsdir="resources/assets-launcher" jarbuilddir="${build}" - jarbasename="jogamp.android-launcher" + jarbasename="jogamp-android-launcher" nativebuilddir="${build}" nativebasename="non-existing" androidmanifest.path="resources/android/AndroidManifest-Launcher.xml" diff --git a/make/scripts/adb-install-all-armv7.sh b/make/scripts/adb-install-all-armv7.sh index 6f271eb..9a0e4f7 100755 --- a/make/scripts/adb-install-all-armv7.sh +++ b/make/scripts/adb-install-all-armv7.sh @@ -1,2 +1,2 @@ -adb $* install ../build-android-armv7/jogamp.android-launcher.apk +adb $* install ../build-android-armv7/jogamp-android-launcher.apk adb $* install ../build-android-armv7/gluegen-rt-android-armeabi-v7a.apk |