Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

aecsocket/rapier-java

Repository files navigation

ARCHIVED: Use rapier-ffi/rapier-java instead

rapier-java

CI

Java bindings for the Rapier physics engine

(note: uses java 19 FFI API, can be upgraded to java 20)

(note: you need jextract to point to a local install of jextract 19)

Building

Quick start

Requirements:

Optional: if updating rapier_ffi, also:

git clone https://github.com/aecsocket/rapier-java
cd rapier-java
git submodule update --init
./gradlew build

To also publish to your local ~/.m2 repo:

./gradlew publishToMavenLocal

Detailed steps

To update rapier_ffi:

  1. ./gradlew generateHeaders

    takes the rapier_ffi/src Rust sources and creates a C header file for FFI in rapier-java-sys/build/librapier.h

  2. ./gradlew generateSys

    takes the C header file and creates Java sources for FFI in rapier-java-sys/src using jextract

  3. Modify the Java source templates in src/main/templates

  4. ./gradlew generateTemplates

    takes the template Java sources in src/main/templates and creates processed Java sources in the rapier-java-dim*-f* variant projects, using the Pebble Templates engine and a Gradle build script

To generate native libraries:

  1. ./gradlew assembleNatives

    compiles rapier_ffi/src Rust sources to a platform-specific shared library in rapier_ffi/target

    • target/debug for dev profile builds (default)
    • target/release for release profile builds (published to Maven central) These files are then copied (during the assemble step) into the rapier-java-natives-* project's JAR

To build the JAR and publish to your local Maven repo:

  1. ./gradlew build

    compiles the processed Java source files from the rapier-java-dim*-f* variant projects into JARs

  2. ./gradlew publishToMavenLocal

    publishes all projects (including headers, variants, natives) to your local ~/.m2

About

Java bindings for the Rapier physics engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors