From e0aae7d797fcfa960fe5bae77c1174c3aece8516 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 17 Feb 2015 14:29:04 +0100 Subject: [PATCH] ant-prepare.sh: add ANDROID_HOME/tools to PATH if it is not there This makes this script more likely to run on various setups, since it does three checks for finding where the `android` utility is: 1. is it in the PATH already? 2. is ANDROID_HOME set? 3. does ~/.android/bashrc exist? This also copies ~/.android/ant.properties into the project for anyone who wants to setup automated tests of `ant release` builds. --- F-Droid/ant-prepare.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/F-Droid/ant-prepare.sh b/F-Droid/ant-prepare.sh index 0eaa3c23b..b12f16bff 100755 --- a/F-Droid/ant-prepare.sh +++ b/F-Droid/ant-prepare.sh @@ -1,5 +1,26 @@ #!/bin/bash -ex +if ! which android > /dev/null; then + if [ -z $ANDROID_HOME ]; then + if [ -e ~/.android/bashrc ]; then + . ~/.android/bashrc + else + echo "'android' not found, ANDROID_HOME must be set!" + exit + fi + else + export PATH="${ANDROID_HOME}/tools:$PATH" + fi +fi + +# set up test signing keys for any `ant release` runs +if [ -e ~/.android/ant.properties ]; then + cp ~/.android/ant.properties ./ +else + echo "skipping release ant.properties" +fi + + EXTERN=../extern place_support_v4() {