language: android

android:
  components:
    - android-21
    - platform-tools
    - build-tools-21.1.2
    - sys-img-armeabi-v7a-android-21
    - android-16
    - sys-img-armeabi-v7a-android-16
    - android-10
    - sys-img-x86-android-10
    - extra-android-support
    - extra-google-m2repository
    - extra-android-m2repository

env:
  matrix:
    - ANDROID_TARGET=android-10   ANDROID_ABI=armeabi
    - ANDROID_TARGET=android-16  ANDROID_ABI=armeabi-v7a
    - ANDROID_TARGET=android-21  ANDROID_ABI=armeabi-v7a

before_install:
    - android list targets
    - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
    - emulator -avd test -no-skin -no-audio -gpu off -no-window &


before_script:
    - adb devices
    - android-wait-for-emulator
    - adb shell input keyevent 82 &

script: ./gradlew connectedAndroidTest --stacktrace

after_failure:
    - adb logcat -d