MovingBlocks / JNLua

Fork of JNI-based Lua scripting language integration for the JVM
MIT License
18 stars 22 forks source link

JNLua (Terasology version)

JNLua (Java Native Lua) is a bridge between the native Lua virtual machine and Java's, utilizing JNI to communicate between the C Lua code and JVM code.

Features

From the original website:

Additionally, the Terasology version provides the following:

Building

To build the Java side of JNLua, a simple "./gradlew build" is sufficient.

Building the natives is more involved. Generally, JNLua expects natives to be present with the following filenames:

libjnlua-[5.2,5.3]-[windows,linux]-[i686,amd64].[dll,so]

To build the natives on Linux you need:

Then simply run ./build-natives-eris.sh and with a little luck you now have shiny new natives compiled for Linux (and Windows).

Note that during the script execution Eris will be cloned into a subdir eris.

On Mac you need general development tools and JAVA_HOME set, to for instance /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home

During initial work on the natives script on Mac that was the only edit needed. Unsure if any additional steps are needed, some were already done.

Run ./build-natives-eris_mac.sh and the Mac OS specific natives should now be yours as well.

In both cases for the unit tests to work the resulting files must be copied into a natives subdir, which Gradle puts on the Java library path.

For instance on Mac make sure the directory exists then simply run cp native-build/* natives and a ./gradlew test should pass all the tests.

Our official build publishes both the JNLua jar and natives to the MovingBlocks Artifactory via publishNatives.gradle and some Jenkins magic.

Mac cloud builds are tricky so for the moment we're using a Jenkins agent on Cervator's Macbook that'll be connected manually when needed.

License

JNLua is licensed under the MIT license which at the time of this writing is the same license as the one of Lua.