Add a Maven build-and-publish path for the Direct-BT fat jar (incl. reproducible multi-arch docker build) - #3
Open
vkolotov wants to merge 2 commits into
Open
Conversation
Adds a maven/ directory that publishes the Java library to a Maven repository as org.direct_bt:direct-bt. The artifact is the fat jar already produced by the CMake build (Java API plus the platform native libraries); publish.sh attaches it and the source zip and runs install or sign-and-deploy using maven/pom.xml for metadata. This lets JVM and OSGi consumers depend on Direct-BT through Maven instead of locating the CMake fat jar by hand. distributionManagement and the deploy path are scaffolding for the maintainer to point at a repository (Maven Central or any Nexus/Artifactory) and run with a signing key. No existing build or sources are changed. See maven/README.md.
publish.sh publishes the fat jar but the CMake build only ever emits the host architecture. This adds scripts/build-fatjar-multiarch.sh: it builds the fat jar in a Debian container per target platform (docker + qemu binfmt) and merges the per-arch natives/<os_and_arch>/ trees into one multi-arch jar — the form a published Maven artifact should take. It replaces the mounted-rootfs cross build in build-preset-cross.sh, which needs private disk images. Default architectures: linux/amd64 + linux/arm64/v8, both built and verified (each native asserted present and confirmed to be the right ELF arch). armhf is omitted by default: on 32-bit ARM sizeof(long double)==sizeof(double), so jaulib's two float_bytes<> specializations collapse to float_bytes<8> and clang rejects the redefinition — re-enable via --platforms once that is fixed upstream. maven/README.md documents both the single-arch and multi-arch build paths.
vkolotov
force-pushed
the
maven-publish
branch
from
August 17, 2026 04:09
e7d4b7b to
1769e77
Compare
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.
Direct-BT ships no binaries — the natives are built from source per-arch and there is no published Maven artifact. This PR adds a self-contained path to build the fat jar (for all supported architectures) and publish it to a Maven repository, so JVM/OSGi consumers can depend on
org.direct_bt:direct-btinstead of locating a CMake-built jar by hand.What's here
Publish (
maven/)maven/pom.xml— artifact metadata only (coordinates, license, scm, distribution target); builds no Java.maven/publish.sh— takes the CMake-built fat jar + source zip and does a localinstallor a signeddeploy.maven/README.md— the single-arch and multi-arch build paths, local install, and public release.Build (
scripts/)scripts/build-fatjar-multiarch.sh— builds the fat jar in a Debian container per target platform (docker + qemu binfmt) and merges the per-archnatives/<os_and_arch>/trees into one multi-arch jar. A reproducible alternative toscripts/build-preset-cross.sh, which needs privately-mounted rootfs disk images.scripts/docker/Dockerfile.fatjar+build-fatjar-in-container.sh— the per-arch build environment (clang toolchain per the README) and in-container build.Architectures
Default
linux/amd64+linux/arm64/v8, both built and verified (each native asserted present and confirmed to be the correct ELF arch).armhfis not in the default set: on 32-bit ARMsizeof(long double) == sizeof(double) == 8, so the twofloat_bytes<>specializations injaulib/include/jau/int_types.hppcollapse to the samefloat_bytes<8>and clang rejects the redefinition. It can be re-enabled via--platformsonce that is resolved in jaulib.