Adrien Béraud | 04d822c | 2015-04-02 17:44:36 -0400 | [diff] [blame] | 1 | #! /bin/bash |
Adrien Béraud | 86759bb | 2016-09-28 13:54:54 -0400 | [diff] [blame] | 2 | # Build Ring daemon and client APK for Android |
Alexandre Lision | 43b9aeb | 2014-07-15 14:21:19 -0400 | [diff] [blame] | 3 | |
| 4 | if [ -z "$ANDROID_ABI" ]; then |
Adrien Béraud | 86759bb | 2016-09-28 13:54:54 -0400 | [diff] [blame] | 5 | ANDROID_ABI="armeabi-v7a x86 x86_64" |
| 6 | echo "ANDROID_ABI not provided, building for ${ANDROID_ABI}" |
Alexandre Lision | 43b9aeb | 2014-07-15 14:21:19 -0400 | [diff] [blame] | 7 | fi |
| 8 | |
Adrien Béraud | 1906f21 | 2016-10-07 12:10:17 -0400 | [diff] [blame] | 9 | pushd ring-android |
| 10 | ./make-swig.sh |
| 11 | popd |
| 12 | |
Romain Bertozzi | 32692de | 2016-10-27 15:16:46 -0400 | [diff] [blame] | 13 | RELEASE=0 |
| 14 | for i in ${@}; do |
| 15 | case "$i" in |
| 16 | release|--release) |
| 17 | RELEASE=1 |
| 18 | ;; |
| 19 | *) |
| 20 | ;; |
| 21 | esac |
| 22 | done |
| 23 | export RELEASE |
| 24 | |
Adrien Béraud | 86759bb | 2016-09-28 13:54:54 -0400 | [diff] [blame] | 25 | ANDROID_ABIS="" |
| 26 | ANDROID_ABI_LIST="${ANDROID_ABI}" |
| 27 | echo "Building ABIs: ${ANDROID_ABI_LIST}" |
| 28 | for i in ${ANDROID_ABI_LIST}; do |
| 29 | echo "$i starts building" |
| 30 | ANDROID_NDK=$ANDROID_NDK ANDROID_SDK=$ANDROID_SDK ANDROID_ABI=$i \ |
Romain Bertozzi | 32692de | 2016-10-27 15:16:46 -0400 | [diff] [blame] | 31 | ./build-daemon.sh $* || { echo "$i build KO"; exit 1; } |
Adrien Béraud | 86759bb | 2016-09-28 13:54:54 -0400 | [diff] [blame] | 32 | echo "$i build OK" |
Alexandre Lision | 7d5df5d | 2014-10-27 13:10:01 -0400 | [diff] [blame] | 33 | done |
Adrien Béraud | 86759bb | 2016-09-28 13:54:54 -0400 | [diff] [blame] | 34 | export ANDROID_ABIS |
| 35 | make -b -j1 RELEASE=$RELEASE apk |