@ -3,6 +3,17 @@
CURDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CURDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION=$(git describe HEAD)
VERSION=$(git describe HEAD)
# Default Android build to arm.
ANDROID_ARCH=${ANDROID_ARCH:-arm}
if [ -z "${ANDROID_FULL_ARCH+x}" ]; then
if [ "$ANDROID_ARCH" = arm ]; then
ANDROID_FULL_ARCH_APK="${ANDROID_FULL_ARCH_APK:-arm-linux-androideabi}"
elif [ "$ANDROID_ARCH" = x86 ]; then
ANDROID_FULL_ARCH_APK="${ANDROID_FULL_ARCH_APK:-i686-linux-android}"
else
ANDROID_FULL_ARCH_APK="${ANDROID_ARCH}"
fi
fi
# Default to Android 4.0+; required for NDK 15 but with a custom NDK the strict minimum is 9.
# Default to Android 4.0+; required for NDK 15 but with a custom NDK the strict minimum is 9.
NDKABI=${NDKABI:-14}
NDKABI=${NDKABI:-14}
export NDKABI
export NDKABI
@ -165,7 +176,7 @@ ${SUPPORTED_TARGETS}"
export NDK="${CURDIR}/base/toolchain/android-ndk-r15c"
export NDK="${CURDIR}/base/toolchain/android-ndk-r15c"
fi
fi
fi
fi
[ -e "${CURDIR}/base/toolchain/android-toolchain/bin/arm-linux-androideabi-gcc " ] || {
[ -e "${CURDIR}/base/toolchain/android-toolchain-${ANDROID_ARCH} /bin/" ] || {
{ [ -e "${NDK}" ] || make -C "${CURDIR}/base/toolchain" android-ndk; }
{ [ -e "${NDK}" ] || make -C "${CURDIR}/base/toolchain" android-ndk; }
make android-toolchain
make android-toolchain
assert_ret_zero $?
assert_ret_zero $?
@ -449,7 +460,7 @@ TARGET:
adb logcat -c
adb logcat -c
# uninstall existing package to make sure *everything* is gone from memory
# uninstall existing package to make sure *everything* is gone from memory
adb uninstall "org.koreader.launcher"
adb uninstall "org.koreader.launcher"
adb install "koreader-android-arm-linux-androideabi -${VERSION}.apk"
adb install "koreader-android-${ANDROID_FULL_ARCH_APK} -${VERSION}.apk"
# there's no adb run so we do this…
# there's no adb run so we do this…
adb shell monkey -p org.koreader.launcher -c android.intent.category.LAUNCHER 1
adb shell monkey -p org.koreader.launcher -c android.intent.category.LAUNCHER 1
adb logcat
adb logcat