2016-05-28 00:24:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e -u
|
|
|
|
|
|
|
|
# Install desired parts of the Android SDK:
|
|
|
|
test -f $HOME/.termuxrc && . $HOME/.termuxrc
|
|
|
|
: ${ANDROID_HOME:="${HOME}/lib/android-sdk"}
|
|
|
|
: ${NDK:="${HOME}/lib/android-ndk"}
|
|
|
|
|
|
|
|
if [ ! -d $ANDROID_HOME ]; then
|
|
|
|
mkdir -p $ANDROID_HOME
|
|
|
|
cd $ANDROID_HOME/..
|
|
|
|
rm -Rf `basename $ANDROID_HOME`
|
|
|
|
|
2017-05-20 21:17:00 +02:00
|
|
|
# https://developer.android.com/studio/index.html#command-tools
|
|
|
|
# The downloaded version below is 26.0.1.:
|
|
|
|
curl --fail --retry 3 \
|
|
|
|
-o tools.zip \
|
|
|
|
https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
|
2017-02-02 02:23:43 +01:00
|
|
|
rm -Rf android-sdk
|
2017-02-02 01:39:29 +01:00
|
|
|
unzip -q tools.zip -d android-sdk
|
|
|
|
rm tools.zip
|
2016-05-28 00:24:50 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d $NDK ]; then
|
|
|
|
mkdir -p $NDK
|
|
|
|
cd $NDK/..
|
|
|
|
rm -Rf `basename $NDK`
|
2018-05-27 14:55:20 +02:00
|
|
|
NDK_VERSION=r17
|
2017-02-02 01:39:29 +01:00
|
|
|
curl --fail --retry 3 -o ndk.zip \
|
|
|
|
http://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-`uname`-x86_64.zip
|
2016-05-28 00:24:50 +02:00
|
|
|
|
2016-07-26 15:06:39 +02:00
|
|
|
rm -Rf android-ndk-$NDK_VERSION
|
2016-05-28 00:24:50 +02:00
|
|
|
unzip -q ndk.zip
|
2016-07-26 15:06:39 +02:00
|
|
|
mv android-ndk-$NDK_VERSION `basename $NDK`
|
2016-05-28 00:24:50 +02:00
|
|
|
rm ndk.zip
|
|
|
|
fi
|
|
|
|
|
2017-11-02 00:21:36 +01:00
|
|
|
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
|
|
|
|
|
2018-03-25 00:02:47 +01:00
|
|
|
# The android-21 platform is used in the ecj package:
|
2018-03-25 00:08:20 +01:00
|
|
|
$ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3" "platforms;android-27" "platforms;android-21"
|