Repository navigation
Conversation
`TARGET=java` generates `source/MeshLibJava/src` with mrbind_gen_java, compiles it and packs `meshlib.jar`. Examples and the 92 tests of MRTestRust ported to Java, built with plain javac. CI runs them in the same Release jobs as Rust, with a Temurin JDK 25 downloaded into the runner temp directory when needed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TARGET=javainscripts/mrbind/generate.mk, on top of the Java generator from MeshInspector/mrbind#55, the same way #7104 addedTARGET=rust. Stacked on #7104.What it does
make -f scripts/mrbind/generate.mk TARGET=javaconsumes the C bindings description JSON (soTARGET=cmust run first, as for C# and Rust), generates the sources intosource/MeshLibJava/src(--package meshlib --force-namespace MR, so the API ismeshlib.mr.Mesh,meshlib.mr.Functions.makeCube(...), ...), compiles them with-Xlint:all -Werror, and packssource/MeshLibJava/meshlib.jar. All of that is ignored by git; only a README is committed insource/MeshLibJava. The bindings use the foreign function API of Java 22, so the jar has no native code of its own: at runtime the MeshLib shared libraries must be injava.library.path.examples/java-examples:MeshBoolean,MeshDecimateandMeshLoadSave, ported from the Rust examples. They're compiled with plainjavac, no build system.source/MRTestJava: the 92 tests ofMRTestRust, ported 1:1. Also plainjavac, with a 60-line runner instead of a test framework, to keep the bindings dependency-free.MeshBooleanand the tests..github/actions/setup-javadownloads a Temurin JDK 25 into the runner's temp directory when the runner has no JDK 22+ (the GitHub-hosted images ship up to 21), likesetup-rustdoes for cargo.build-mrbindkeeps and stripsmrbind_gen_javatoo.thirdparty/mrbindgitlink points at the head of Add a Java bindings generator on top of the C bindings mrbind#55, to be re-bumped after that PR merges.Testing
Locally on Windows:
generate_win.bat TARGET=javafrom the CI description JSON compiles all 37764 functions (3157 classes) in ~20 s with zero warnings, and 91 of the 92 tests pass against the 3.1.4 NuGet binaries (the one failure callsMR_computePerFaceNormals_1, which those binaries predate; the Rust tests have the same local failure).MeshBooleanruns and writesout_boolean.stl.🤖 Generated with Claude Code