Login  Register

Re: Jar file name pedantry

Posted by Sven Gothel on Jun 25, 2012; 7:10pm
URL: https://forum.jogamp.org/Jar-file-name-pedantry-tp4025305p4025318.html

On 06/25/2012 06:35 PM, tyro [via jogamp] wrote:
> Yes, that's it. I'd like to see "-" used consistently.
>
> I did speak to Sven briefly about it and he seemed to be in favour, but has
> yet to comment.

Sorry for my extended silence.

TO show the changes of filenames here is the diff:

--- ../../jogl-file-name-old.txt        2012-06-25 20:43:00.059353724 +0200
+++ ../../jogl-file-name-new.txt        2012-06-25 20:43:17.567084888 +0200
@@ -39,12 +39,12 @@
 jocl-natives-solaris-i586.jar
 jocl-natives-windows-amd64.jar
 jocl-natives-windows-i586.jar
-jogamp.android-launcher.apk
-jogamp.android-launcher-unsigned.apk
-jogl.all-android-armeabi-v7a.apk
-jogl.all-android-armeabi-v7a-unsigned.apk
-jogl.all.jar
-jogl.all-mobile.jar
+jogamp-android-launcher.apk
+jogamp-android-launcher-unsigned.apk
+jogl-all-android-armeabi-v7a.apk
+jogl-all-android-armeabi-v7a-unsigned.apk
+jogl-all.jar
+jogl-all-mobile.jar
 jogl-all-natives-android-armv7.jar
 jogl-all-natives-linux-amd64.jar
 jogl-all-natives-linux-armv7hf.jar
@@ -55,7 +55,7 @@
 jogl-all-natives-solaris-i586.jar
 jogl-all-natives-windows-amd64.jar
 jogl-all-natives-windows-i586.jar
-jogl.all-noawt.jar
-jogl.test-android.apk
-jogl.test-android-unsigned.apk
-jogl.test.jar
+jogl-all-noawt.jar
+jogl-test-android.apk
+jogl-test-android-unsigned.apk
+jogl-test.jar

Besides the Android launcher of GlueGen (which does not matter due to it's
special deployment), only the jogl.all* Java  Jar files differ.

Mark's (Tyro) motivation was beauty at first, i.e.
inconsistency of the file naming scheme.

I double checked our native JAR file loading mechanism,
which gives this change a technical motivation.

+++

JNILibLoaderBase:
  public static boolean addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames) {..}

GLProfile's usage:
  JNILibLoaderBase.addNativeJarLibs(GLProfile.class, "jogl-all", { "nativewindow", "jogl" });

+++

The above indicates (which is true) that we derive the native JAR URL by:
  <URI path from 'classFromJavaJar'> + "/" + 'allNativeJarBaseName' + "-" + <os.and.arch> + ".jar"

The above does not allow us to change the JARs basename if required
as it is intrinsic when using maven, for example.
Of course, other situations may occur as well .. when dealing w/ custom user packaging.

For example in maven, Mark figured out how to use a naming scheme like:
  - jogl-all-<version>.jar
  - jogl-all-<version>-natives-<os.and.arch>.jar

@Mark: Please confirm the above!

Yes, this still would 'only' work for the 'all' java package names,
the atomic JAR naming scheme would still require the basename.
Maybe you have a good solution to this ?


The proposed jogl.all* Java name change would also lead to:

+++

JNILibLoaderBase:
  public static boolean addNativeJarLibs(Class<?> classFromJavaJar, String[] atomicNativeJarBaseNames) {..}

GLProfile's usage:
  JNILibLoaderBase.addNativeJarLibs(GLProfile.class, { "nativewindow", "jogl" });

+++

The above would imply that we derive the native JAR URL by:
  <URI from 'classFromJavaJar' w/o ".jar" suffix> + "-" + <os.and.arch> + ".jar"

+++

Note: It would be a bad workaround to attempt to load variations of
native JAR URLs, since this would impact the loading time.
Keep in mind that each attempt to load a URL might be a network connection.

+++

I know this change would ask people to change their project files
and us to change all our documentation and examples.
Hence it has a huge impact.

Question is, whether this remedy is worth the amount of work and
probably the confusion.

Please digest and give your statements.

In the end, I think this change is a good one.

~Sven



signature.asc (910 bytes) Download Attachment