Bug 559162

Summary: SWT Automatic module names should be independent to architecture
Product: [Eclipse Project] Platform Reporter: Antonio Petrelli <antonio.petrelli>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: antonio.petrelli
Version: 4.15   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Antonio Petrelli CLA 2020-01-14 10:08:50 EST
Currently the automatic module name for SWT JARs, as published in the manifest, is:
org.eclipse.swt.gtk.linux.x86_64
So it is architecture and platform dependent. On the contrary, they should have the same name, because:
1. the compilation can be made on any variant of the SWT library,
2. the correct library must be used at runtime;
3. it is difficult to create a portable application that consists of a common jar and multiple jars different for every architecture.

For an example of point 3:
1. you have common code that uses SWT
2. you have specific code that uses something for Linux and uses the code at point 1;
3. you have specific code that uses Windows and uses the code at point 1

Now you may think that is unlikely to have problem at runtime, but if you think to use GraalVM native compilation, then you might notice that it is hard to compile a Windows binary with a Linux specific JAR.

If the automatic module names were the same, the Windows JAR can use SWT Windows variant and the Linux JAR can use the Linux variant, when doing native compilation.

Moreover, all basic Java code has the same module names for all platforms, despite having different JNI code.