#!/bin/bash
#
+echo $0
set -e
+set -x
if [ -z $ANDROID_HOME ]; then
echo "ANDROID_HOME env var must be set!"
cd /vagrant/cache
-# make hard links for `android update sdk` to use and delete
+# make links for `android update sdk` to use and delete
for f in android_*.zip android-[0-9]*.zip platform-[0-9]*.zip build-tools_r*-linux.zip; do
rm -f ${ANDROID_HOME}/temp/$f
ln -s /vagrant/cache/$f ${ANDROID_HOME}/temp/
# install all cached build-tools
for f in `ls -1 build-tools*.zip`; do
ver=`unzip -c $f "*/source.properties" | sed -n 's,^Pkg.Revision=,,p'`
+ if [[ $ver == 24.0.0 ]] && [[ $f =~ .*r24\.0\.1.* ]]; then
+ # 24.0.1 has the wrong revision in the zip
+ ver=24.0.1
+ fi
cached=,build-tools-${ver}${cached}
done
-${ANDROID_HOME}/tools/android --silent update sdk --no-ui --all \
+${ANDROID_HOME}/tools/android update sdk --no-ui --all \
--filter platform-tools,extra-android-m2repository${cached} <<EOH
y