[WIP] Experiment with jpackage to create executable binaries
Still in experimenting phase
Created a new module JpackageModule, which wraps around the jpackage tool, that's part of newer JDK releases and is used to produced native executables and distributable packages.
Although, there are some configuration points, in most cases, it should be as easy usable as assembly.
> mill show foo.jpackage
[1/1] show > [93/93] foo.jpackageAppImage
".../out/foo/jpackageAppImage.dest/out/foo/bin/foo"
> file out/foo/jpackageAppImage.dest/image/foo/bin/foo
out/foo/jpackageAppImage.dest/out/foo/bin/foo: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, not stripped
Based on https://dotnet.social/@fornever/112560707798240443, which points to https://fornever.me/en/posts/2024-06-05.scala-jpackage-publishing.html, I tried to implement a generic jpackage target that can produce self-contained executables for any JavaModule (or ScalaModule). This is a WIP PR just to see what works.
Merged as part of https://github.com/com-lihaoyi/mill/pull/4038