Browse Source

Fix Travis CI

duke
Yusuf Sahin HAMZA 4 years ago
parent
commit
ca83ae9a30
  1. 29
      .travis.yml
  2. 25
      tools/android-wait-for-emulator.sh

29
.travis.yml

@ -1,7 +1,28 @@
language: android
dist: trusty
jdk: oraclejdk8
env:
global:
- ANDROID_TARGET=android-22
- ANDROID_ABI=armeabi-v7a
android:
components:
- build-tools-26.0.2
- android-26
- extra
- tools
- platform-tools
- build-tools-28.0.3
- android-28
- $ANDROID_TARGET
- extra-android-m2repository
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
before_script:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
- emulator -avd test -no-window &
- bash ./tools/android-wait-for-emulator.sh
- adb shell input keyevent 82 &
script:
- bash ./gradlew build
- bash ./gradlew test -x lint --stacktrace

25
tools/android-wait-for-emulator.sh

@ -0,0 +1,25 @@
#!/bin/bash
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
set +e
bootanim=""
failcounter=0
timeout_in_sec=360
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
|| "$bootanim" =~ "running" ]]; then
let "failcounter += 1"
echo "Waiting for emulator to start"
if [[ $failcounter -gt timeout_in_sec ]]; then
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
exit 1
fi
fi
sleep 1
done
echo "Emulator is ready"
Loading…
Cancel
Save