CI: Do not trust the SDK with reading echo y

It will randomly fail, so be extra careful. `yes` or echoing without the
sleep will also fail because the SDK sucks at reading a single line.

Also remove the ANDROID_HOME test since this now runs on the public
workers with their default image, which don't have the SDK preinstalled.

And ignore SDK install errors, since it likes to complain about not
being able to stop the ADB server. If anything doesn't install properly,
it will cause errors down the line and CI will fail anyway.
This commit is contained in:
Daniel Martí 2016-03-21 13:58:26 +00:00
parent 1870256803
commit 6606a76848

View File

@ -4,17 +4,15 @@ before_script:
- apt-get -q install -y wget tar unzip python3
- echo " == Installing OpenJDK 7"
- apt-get -q install -y openjdk-7-jdk
- test -z "$ANDROID_HOME" &&
echo " == Installing Android SDK" &&
apt-get -q install -y lib32stdc++6 lib32z1 &&
wget -q -O android-sdk.tgz https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz &&
tar -xzf android-sdk.tgz &&
export ANDROID_HOME=$PWD/android-sdk-linux &&
export PATH="$ANDROID_HOME/tools:$PATH" &&
echo y | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2,android-22,extra-android-m2repository &&
export PATH="$ANDROID_HOME/platform-tools:$PATH" &&
export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH" &&
echo y | android -s update sdk --no-ui -a -t android-10
- echo " == Installing Android SDK"
- apt-get -q install -y lib32stdc++6 lib32z1
- wget -q -O android-sdk.tgz https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
- tar -xzf android-sdk.tgz
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH="$ANDROID_HOME/tools:$PATH"
- export PATH="$ANDROID_HOME/platform-tools:$PATH"
- export PATH="$ANDROID_HOME/build-tools/23.0.2:$PATH"
- while true; do echo y; sleep 1; done | android -s update sdk --no-ui -a -t platform-tools,tools,build-tools-23.0.2,android-22,extra-android-m2repository,android-10 || true
test:
script: