From 2c1c07e185b4d7ef0f6e4a20b44f25aa1f2afeab Mon Sep 17 00:00:00 2001 From: Yemel Jardi Date: Thu, 17 Jul 2014 21:03:21 -0300 Subject: [PATCH] Automate building production ready apk --- .gitignore | 1 + android/build.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0a7848506..7294d7d4d 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ version.js android/package android/*.apk +android/*.keystore coverage/ diff --git a/android/build.sh b/android/build.sh index 1fe079a45..313aa0320 100644 --- a/android/build.sh +++ b/android/build.sh @@ -26,6 +26,16 @@ then DEBUG="--enable-remote-debugging" fi +if [[ $# -eq 1 && ! $1 = "-d" ]] +then + if [ ! -f $BUILDDIR/copay.keystore ] + then + echo "${OpenColor}${Red}* Can't build production app without a keystore${CloseColor}" + exit 1 + fi + PRODUCTION="--keystore-path=$BUILDDIR/copay.keystore --keystore-alias=copay_play --keystore-passcode=$1" +fi + # Move to the build directory cd $BUILDDIR @@ -54,7 +64,7 @@ checkOK # Building the APK echo "${OpenColor}${Green}* Building APK file...${CloseColor}" cd $CROSSWALK -python make_apk.py --manifest=$APPDIR/manifest.json --target-dir=$BUILDDIR $DEBUG --package=com.bitpay.copay +python make_apk.py --manifest=$APPDIR/manifest.json --package=com.bitpay.copay --arch=arm --target-dir=$BUILDDIR $DEBUG $PRODUCTION checkOK cd $BUILDDIR