libzmq/builds/android/ci_build.sh
Stephan Guilloux (cos) 0d49eddf16 Problem: Android build script may fail silently
Solution: Use `set -e`

Note:
To be reported in ZPROJECT, when generating the same for CZMQ & ZYRE.

Note:
`make clean` may fail when Makefile is not yet generated
(case of 1st call of build.sh after git clone).

Additionnaly, cleaned the dependency folder
(report of ZPROJECT generated scripts).
2022-10-02 02:27:12 +02:00

39 lines
727 B
Bash
Executable File

#!/usr/bin/env bash
#
# Exit if any step fails
set -e
export NDK_VERSION=android-ndk-r25
export ANDROID_NDK_ROOT="/tmp/${NDK_VERSION}"
# Cleanup.
rm -rf /tmp/tmp-deps
mkdir -p /tmp/tmp-deps
case $(uname | tr '[:upper:]' '[:lower:]') in
linux*)
HOST_PLATFORM=linux
;;
darwin*)
HOST_PLATFORM=darwin
;;
*)
echo "Unsupported platform"
exit 1
;;
esac
if [ ! -d "${ANDROID_NDK_ROOT}" ]; then
export FILENAME=$NDK_VERSION-$HOST_PLATFORM.zip
(cd '/tmp' \
&& wget http://dl.google.com/android/repository/$FILENAME -O $FILENAME &> /dev/null \
&& unzip -q $FILENAME) || exit 1
unset FILENAME
fi
./build.sh "arm"
./build.sh "arm64"
./build.sh "x86"
./build.sh "x86_64"