For the last few days I have been trying to find a good way to solve this problem: I want to use LWJGL (http://lwjgl.org) in a project, but LWJGL uses native libraries (C/C++ shared libraries), which seems to make things a little less straightforward than usual. This page illustrates how to use LWJGL in Maven: http://lwjgl.org/wiki/index.php?title=LWJGL_use_in_Maven It looks like there is a Maven plugin to automatically handle this sort of thing, but even without such a plugin, it seems like it shouldn’t be too hard to accomplish the same.
It appears that they are checking for classifiers that look like “natives-${OS}” and then unpacking the jars into a specific directory that is added to java.library.path.
It appears the plugin (http://code.google.com/p/mavennatives/) offers a certain amount of customization of where the dependencies are unpacked to. By default it seems to unpack the native dependencies to the “target/natives” directory, but “when enabling separateDirs the plugin will unpack each native dependency to a subdir of the nativesTargetDir named like its classifier (for example: natives-windows will go to target/natives/windows)”. I’m not sure if there is a standard location preferred in Java projects, although the separate directories approach seems like it could be better to me.
Could anyone here show me the best way to achieve similar results with Gradle?
I should probably mention that I am completely new to both Java and Gradle, so please have patience with me.