Building a complete LWJGL release from source

Started by tomn, August 29, 2018, 09:54:06

Previous topic - Next topic

tomn

Hi all, I'm trying to rebuild a complete LWJGL release from source on my local machine (because reasons). As per the instructions at https://github.com/LWJGL/lwjgl3/tree/master/doc, I cloned the code from GitHub and ran the Ant builds.

At first sight, this all went smoothly for both Windows and Linux. However, I was hoping I'd end up with something like lwjgl-3.2.0.zip as output (or at least the JAR files contained therein), but this is not the case. It creates native libs and .class files, but doesn't package them. I tried running the Gradle build as well, but that seems to have little effect other than creating a bin/MAVEN/ivy.xml file. Both Ant and Gradle report the build as successful.

Any ideas on this? Is there a build step I'm missing? Thanks in advance!

KaiHH

Have a look at the build.xml file. There is a "release" target which will bundle the modules as jar files.
You get a full build with:
ant compile-templates release
This will create the modules' jar files in bin/RELEASE/<module>

tomn

Ah! I had tried to list the available targets using ant -p, but then "release" wasn't one of them. All good now, thanks!

KaiHH

Quote from: tomn on August 29, 2018, 10:57:23
Ah! I had tried to list the available targets using ant -p, but then "release" wasn't one of them. All good now, thanks!
ant -p seems to only list "main targets", which are those with a description attribute. If you want to list all targets ("other targets" called in Ant), you can use ant -v -p

spasi

Please note that the release target is intentionally not documented. All native libraries in the resulting build are downloaded from the official LWJGL CI infrastructure, so any customizations you may have done locally won't make it to the final binaries. Unless the changes are Java-only, it's only useful for building the official LWJGL snapshots & releases, not for custom builds.

A few simple changes could make it applicable to custom builds, but I don't have a good answer on how it would work with cross-platform binaries. Without any changes, a fiddly solution would be to let ant release run, then replace any binaries you want in the jars. The release target does not sign anything, so you could probably automate this without much trouble.

tomn

Thanks for pointing that out. To put this into context: I'm looking at migrating a large existing codebase from JogAmp to LWJGL. Company policy dictates that we must be able to locally rebuild all third-party libraries that we use, so that we can patch them ourselves in case of emergency. It doesn't matter if it requires a bit of fiddling with the native libraries -- it's definitely not something I'll be doing every day (if ever).