Add Android cross-compilation to CI and publish .so artifacts
Currently the dEdx Android app vendors a copy of the
libdedx C source directly in the repository and compiles it as part of the Android NDK build.
This is fragile: the vendored copy drifts out of sync, and any changes to libdedx require a
manual sync.
The clean solution is to have libdedx publish pre-built .so files for Android ABIs as GitHub
release artifacts, so the app can download and embed them directly without building from source.
What is needed
Add a GitHub Actions workflow to libdedx that cross-compiles for the following Android ABIs
using the Android NDK:
arm64-v8a (primary target, modern devices)
armeabi-v7a (32-bit ARM, older devices)
x86_64 (emulator)
And publishes the resulting libdedx.so files as artifacts on each release.
Expected outcome
The dEdx Android app build can then:
- Download the pre-built
.so files for each ABI
- Place them in
app/src/main/jniLibs/<abi>/libdedx.so
- Remove the vendored
libdedx/ source tree entirely
- Reduce
CMakeLists.txt to just compiling the thin JNI wrapper dEdx.c against the
pre-built library
This gives a clean separation between libdedx development and app development, and ensures
the app always uses an officially built and tested version of the library.
Add Android cross-compilation to CI and publish
.soartifactsCurrently the dEdx Android app vendors a copy of the
libdedx C source directly in the repository and compiles it as part of the Android NDK build.
This is fragile: the vendored copy drifts out of sync, and any changes to libdedx require a
manual sync.
The clean solution is to have libdedx publish pre-built
.sofiles for Android ABIs as GitHubrelease artifacts, so the app can download and embed them directly without building from source.
What is needed
Add a GitHub Actions workflow to libdedx that cross-compiles for the following Android ABIs
using the Android NDK:
arm64-v8a(primary target, modern devices)armeabi-v7a(32-bit ARM, older devices)x86_64(emulator)And publishes the resulting
libdedx.sofiles as artifacts on each release.Expected outcome
The dEdx Android app build can then:
.sofiles for each ABIapp/src/main/jniLibs/<abi>/libdedx.solibdedx/source tree entirelyCMakeLists.txtto just compiling the thin JNI wrapperdEdx.cagainst thepre-built library
This gives a clean separation between libdedx development and app development, and ensures
the app always uses an officially built and tested version of the library.