Slackbot
04/19/2022, 10:57 AMdaniel
04/19/2022, 2:44 PMCCompile
task and one of the link task, however, it wasn’t ever intended to be used as standalone task. Hopefully we can fix that in Nokee but for now, it would be recommended to use one of the plugins. For compiling C sources, Nokee provide the dev.nokee.c-library
and dev.nokee.c-application
plugin which produce one of two entry point (a library, either static or shared, or application). However, in your specific case of producing a JNI library, I would recommend using the dev.nokee.jni-library
plugin as it does a bit more such as wiring the shared library to the Test
task, produce a JNI JAR (a JAR with the built shared library), adds the JVM includes, generate the JNI includes for native
class, etc.Giuseppe Barbieri
04/19/2022, 2:48 PMdaniel
04/19/2022, 2:49 PMGiuseppe Barbieri
04/19/2022, 2:54 PMGiuseppe Barbieri
04/19/2022, 2:54 PMdaniel
04/19/2022, 2:55 PMdaniel
04/19/2022, 3:12 PMgenerated
folder which seems to be Java/JNI binding for some libraries. The files are already in source control for when the source library are not present. Then all of those native files are compiled together into the JNI shared library as well as the Java sources. Then I assume a JVM JAR contains the compiled classes and several JNI JAR for each of the JNI shared library. Does that seems accurate in what is happening?Giuseppe Barbieri
04/19/2022, 3:12 PMGiuseppe Barbieri
04/19/2022, 3:12 PMGiuseppe Barbieri
04/19/2022, 3:15 PMGiuseppe Barbieri
04/19/2022, 3:15 PMGiuseppe Barbieri
04/19/2022, 3:22 PM> > The files are already in source control for when the source library are not present.Not sure what that means. The generated files are source controlled because it's generally useful (tracking changes, history, etc.)
> Then all of those native files are compiled together into the JNI shared libraryThe shared library may be produced by compiling both generated and non-generated files. It's not the same for all modules though. Some have generated sources only, others have both.
> Then I assume a JVM JAR contains the compiled classes and several JNI JAR for each of the JNI shared libraryA single build produces a classes JAR and a single natives JAR per module. Some modules don't even have a natives JAR, they're Java-only. The natives JAR contains the shared library for the build's target platform. Shared libraries for other platforms are produced by LWJGL's github actions infrastructure (see the LWJGL-CI account).