mirror of
https://code.gri.mw/GUI/grim.git
synced 2026-07-12 09:48:55 +00:00
ci: cache, local maven for android build and artifacts, fix telegram upload
Reviewed-on: https://code.gri.mw/GUI/grim/pulls/37
This commit is contained in:
+17
-7
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage="Usage: android.sh [type] [platform|version]\n - type: 'build' to run locally, 'lib' - .so for all platforms, 'release' - .apk for all platforms\n - platform, for 'build' type: 'v7', 'v8', 'x86'\n - version for 'lib' and 'release', example: '0.2.2'"
|
||||
usage="Usage: android.sh [type] [platform|version] [flavor]\n - type: 'build' to run locally, 'lib' - .so for all platforms, 'release' - .apk for all platforms\n - platform, for 'build' type: 'v7', 'v8', 'x86'\n - version for 'lib' and 'release', example: '0.2.2'\n - flavor, for non-'lib' type: 'ci' for local maven, 'local' for external"
|
||||
case $1 in
|
||||
build|lib|release)
|
||||
;;
|
||||
@@ -19,6 +19,16 @@ if [[ $1 == "build" ]]; then
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ $1 != "lib" ]]; then
|
||||
case $3 in
|
||||
ci|local)
|
||||
;;
|
||||
*)
|
||||
printf "$usage"
|
||||
exit 1
|
||||
esac
|
||||
fi
|
||||
|
||||
# Setup build directory
|
||||
BASEDIR=$(cd "$(dirname "$0")" && pwd)
|
||||
cd "${BASEDIR}" || exit 1
|
||||
@@ -59,17 +69,17 @@ function build_apk() {
|
||||
./gradlew clean
|
||||
# Build signed apk if keystore exists
|
||||
if [ ! -f keystore.properties ]; then
|
||||
./gradlew assembleDebug
|
||||
./gradlew assemble$3Debug
|
||||
if [ $? -ne 0 ]; then
|
||||
success=0
|
||||
fi
|
||||
apk_path=app/build/outputs/apk/debug/app-debug.apk
|
||||
apk_path=app/build/outputs/apk/$3/debug/app-$3-debug.apk
|
||||
else
|
||||
./gradlew assembleSignedRelease
|
||||
./gradlew assemble$3SignedRelease
|
||||
if [ $? -ne 0 ]; then
|
||||
success=0
|
||||
fi
|
||||
apk_path=app/build/outputs/apk/signedRelease/app-signedRelease.apk
|
||||
apk_path=app/build/outputs/apk/$3/signedRelease/app-$3-signedRelease.apk
|
||||
fi
|
||||
|
||||
if [[ $1 == "" ]] && [ $success -eq 1 ]; then
|
||||
@@ -118,10 +128,10 @@ else
|
||||
rm -rf target/armv7-linux-androideabi
|
||||
build_lib "v7"
|
||||
[ $success -eq 1 ] && build_lib "v8"
|
||||
[ $success -eq 1 ] && build_apk "arm" "$2"
|
||||
[ $success -eq 1 ] && build_apk "arm" "$2" "$3"
|
||||
rm -rf android/app/src/main/jniLibs/*
|
||||
[ $success -eq 1 ] && build_lib "x86"
|
||||
[ $success -eq 1 ] && build_apk "x86_64" "$2"
|
||||
[ $success -eq 1 ] && build_apk "x86_64" "$2" "$3"
|
||||
[ $success -eq 1 ] && exit 0
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user