freedomlayer / offset

Offset payment engine
https://www.offsetcredit.org
Other
164 stars 20 forks source link

Add Android builds to CI #271

Closed realcr closed 4 years ago

realcr commented 4 years ago

Offst's stcompact binary is designed to work on mobile devices, specifically on Android.

We want to compile it for the following architectures:

More specifically, we want the CI to compile for those architectures during testing, and create a release binary when a new version tag is pushed to this repository.

Currently the automatic CI build system compiles and tests Offset for Windows, linux and macos. Building for the Android architectures mentioned above is probably a bit different, because cross compilation is required.

I managed to perform cross compilation successfully on my machine (Ubuntu 18.04) by following the instructions from mozilla's website, with some minor modifications:

[target.aarch64-linux-android]
ar = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar"
linker = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-clang"

[target.armv7-linux-androideabi]
ar = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-android26-ar"
linker = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-android26-clang"

[target.i686-linux-android]
ar = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-ar"
linker = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-clang"

I need some help with making this work on the travis CI. My current gap in knowledge is how to install the android SDK and the NDK on the travis CI. Alternatively, maybe travis CI has special support for this case.

realcr commented 4 years ago

Solved in PR https://github.com/freedomlayer/offset/pull/280