You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This uses a big switch statement to pick the natives for the current operating system. This is nice for development runs, but horrible when distributing with something like shadowJar: it will generate a fat jar file containing only the natives of the operating system that built it. This would cause the jar to work very well on the machine of the developer, but fail on any machine with a different operating system or architecture due to missing natives. If the developer doesn't open it up with an archive manager or tests on a different machine, he wouldn't even find out.
With this file, the natives for all operating systems will always be included, regardless on which operating system it is built. If shadowJar would be used on such a build file, the produced jar file will contain all natives and therefor work on all supported platforms. I would consider this more the Java way to do things.
This example was just for gradle, but similar arguments should hold for the other supported build systems as well. Note: If there is a better than way than shadowJar to distribute lwjgl applications, please let me know!
The text was updated successfully, but these errors were encountered:
When using the build configurator to create a gradle build file with only the core of LWJGL, it will generate the following file:
This uses a big switch statement to pick the natives for the current operating system. This is nice for development runs, but horrible when distributing with something like shadowJar: it will generate a fat jar file containing only the natives of the operating system that built it. This would cause the jar to work very well on the machine of the developer, but fail on any machine with a different operating system or architecture due to missing natives. If the developer doesn't open it up with an archive manager or tests on a different machine, he wouldn't even find out.
I would instead generate a file like this:
With this file, the natives for all operating systems will always be included, regardless on which operating system it is built. If shadowJar would be used on such a build file, the produced jar file will contain all natives and therefor work on all supported platforms. I would consider this more the Java way to do things.
This example was just for gradle, but similar arguments should hold for the other supported build systems as well. Note: If there is a better than way than shadowJar to distribute lwjgl applications, please let me know!
The text was updated successfully, but these errors were encountered: