nandi/libjavapublic Fork 0
066bac4
Commits
Clone
git clone https://git.rickub.com/nandi/libjava.git
git clone ssh://git@rickub.com/nandi/libjava.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Add `just build` to compile the example binary into out/

A release build of examples/demo.nim landing at out/demo, with nimcache
kept under build/ so nothing is left beside the sources. Depends on the
`java` recipe, since the demo needs the compiled fixtures at runtime.

out/ joins build/ in .gitignore, and `just clean` removes it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandithebull committed 2026-09-20T14:21:57-07:00 Browse files
066bac4 parent: 5ccc9c1
modified .gitignore +1 -0
@@ -1,5 +1,6 @@
11 # Build outputs
22 build/
3+out/
34 nimcache/
45 *.class
56
@@ -1,5 +1,6 @@
1 # Build outputs1 # Build outputs
2 build/2 build/
3+out/
3 nimcache/4 nimcache/
4 *.class5 *.class
5 6
modified README.md +3 -2
@@ -25,8 +25,9 @@ nimble test
2525 nimble demo
2626 ```
2727
28-There is also a `justfile` wrapping these, plus `just check`, `just docs`,
29-`just clean` and `just jdk` (prints the JDK that will be linked). `just -l`
28+There is also a `justfile` wrapping these. `just build` produces a release
29+binary of the example at `out/demo`; `just check`, `just docs`, `just clean`
30+and `just jdk` (prints the JDK that will be linked) round it out. `just -l`
3031 lists them; the nimble tasks stay the source of truth.
3132
3233 Pass `-d:libjavaNoLink` if your process already has the JVM symbols — when
@@ -25,8 +25,9 @@ nimble test
25 nimble demo25 nimble demo
26 ```26 ```
27 27
28-There is also a `justfile` wrapping these, plus `just check`, `just docs`,28+There is also a `justfile` wrapping these. `just build` produces a release
29-`just clean` and `just jdk` (prints the JDK that will be linked). `just -l`29+binary of the example at `out/demo`; `just check`, `just docs`, `just clean`
30+and `just jdk` (prints the JDK that will be linked) round it out. `just -l`
30 lists them; the nimble tasks stay the source of truth.31 lists them; the nimble tasks stay the source of truth.
31 32
32 Pass `-d:libjavaNoLink` if your process already has the JVM symbols — when33 Pass `-d:libjavaNoLink` if your process already has the JVM symbols — when
modified justfile +5 -1
@@ -17,6 +17,10 @@ test:
1717 demo:
1818 nimble demo
1919
20+# Compile the example binary into out/ (release build, nothing left in-tree)
21+build: java
22+ nim c -d:release --path:src --nimcache:build/nimcache -o:out/demo examples/demo.nim
23+
2024 # Type-check the library without producing a binary.
2125 # `nim check` does not run `staticExec`, so config.nim's PATH-based JDK
2226 # fallback is unavailable there — resolve the home here and pass it in.
@@ -32,7 +36,7 @@ docs:
3236
3337 # Remove build outputs and compiled test/example binaries
3438 clean:
35- rm -rf build nimcache
39+ rm -rf build nimcache out
3640 rm -f tests/tlibjava examples/demo
3741
3842 # Print the JDK this build will link against
@@ -17,6 +17,10 @@ test:
17 demo:17 demo:
18 nimble demo18 nimble demo
19 19
20+# Compile the example binary into out/ (release build, nothing left in-tree)
21+build: java
22+ nim c -d:release --path:src --nimcache:build/nimcache -o:out/demo examples/demo.nim
23+
20 # Type-check the library without producing a binary.24 # Type-check the library without producing a binary.
21 # `nim check` does not run `staticExec`, so config.nim's PATH-based JDK25 # `nim check` does not run `staticExec`, so config.nim's PATH-based JDK
22 # fallback is unavailable there — resolve the home here and pass it in.26 # fallback is unavailable there — resolve the home here and pass it in.
@@ -32,7 +36,7 @@ docs:
32 36
33 # Remove build outputs and compiled test/example binaries37 # Remove build outputs and compiled test/example binaries
34 clean:38 clean:
35- rm -rf build nimcache39+ rm -rf build nimcache out
36 rm -f tests/tlibjava examples/demo40 rm -f tests/tlibjava examples/demo
37 41
38 # Print the JDK this build will link against42 # Print the JDK this build will link against