From c0ead6fa10280f8076704726d59f482b183fd77e Mon Sep 17 00:00:00 2001
From: Sven Gothel
+ * Generic description:
+ *
+ return JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core", "-android" } );
+ *
+ * If Class1.class
is contained in a JAR file which name includes singleJarMarker
-all,
+ * implementation will attempt to resolve the native JAR file as follows:
+ *
+ *
+ * Otherwise the native JAR files will be resolved for each class's JAR file:
+ *
+ *
+ */
+ public static final boolean addNativeJarLibsJoglCfg(final Class>[] classesFromJavaJars) {
+ return addNativeJarLibs(classesFromJavaJars, "-all", joglDeployCfg);
+ }
+ private static final String[] joglDeployCfg = new String[] { "-noawt", "-mobile", "-core", "-android" };
+
/**
* Loads and adds a JAR file's native library to the TempJarCache.
* The native library JAR file's URI is derived as follows:
@@ -223,37 +247,59 @@ public class JNILibLoaderBase {
*
- *
+ *
+ final ClassLoader cl = GLProfile.class.getClassLoader();
+ final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
+ final Class>[] classesFromJavaJars = new Class>[] { Class1.class, Class2.class };
+ JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-suff1", "-suff2" } );
+ *
+ * If Class1.class
is contained in a JAR file which name includes singleJarMarker
, here -all,
+ * implementation will attempt to resolve the native JAR file as follows:
+ *
+ *
+ * Otherwise the native JAR files will be resolved for each class's JAR file:
+ *
+ *
+ *
+ * Examples: + *
+ ** JOCL: *
- // only: jocl.jar -> jocl-natives-'os.and.arch'.jar + // only: jocl.jar -> jocl-natives-os.and.arch.jar addNativeJarLibs(new Class>[] { JOCLJNILibLoader.class }, null, null ); ** * Newt Only: *
- // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-- * + * + *.jar - // or: nativewindow-core.jar -> nativewindow-natives- .jar, - // newt-core.jar -> newt-natives- .jar - JNILibLoaderBase.addNativeJarLibs(new Class>[] { NWJNILibLoader.class, NEWTJNILibLoader.class }, "-all", new String[] { "-noawt", "-mobile", "-core" } ); + // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar, jogl-all-android.jar] -> jogl-all-natives-os.and.arch.jar + // or: nativewindow-core.jar -> nativewindow-natives-os.and.arch.jar, + // newt-core.jar -> newt-natives-os.and.arch.jar + JNILibLoaderBase.addNativeJarLibs(new Class>[] { NWJNILibLoader.class, NEWTJNILibLoader.class }, "-all", new String[] { "-noawt", "-mobile", "-core", "-android" } ); *
* JOGL: *
final ClassLoader cl = GLProfile.class.getClassLoader(); - // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-+ * * * @param classesFromJavaJars For each given Class, load the native library JAR. * @param singleJarMarker Optional string marker like "-all" to identify the single 'all-in-one' JAR file -- cgit v1.2.3.jar - // or: nativewindow-core.jar -> nativewindow-natives- .jar, - // jogl-core.jar -> jogl-natives- .jar, - // (newt-core.jar -> newt-natives- .jar)? (if available) + // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar, jogl-all-android.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" } ); + JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core", "-android" } ); *