language: android
jdk:
  - oraclejdk8

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.android/build-cache

android:
  components:
    - tools
    - platform-tools
    - build-tools-26.0.0
    - android-25
    - extra-google-m2repository
    - extra-android-m2repository
  licenses:
    - android-sdk-preview-license-.+
    - android-sdk-license-.+
    - google-gdk-license-.+

before_install:
  - chmod +x gradlew

after_failure:
  - cat $TRAVIS_BUILD_DIR/app/build/outputs/lint-results-debug.xml

script:
  - ./gradlew clean build connectedCheck -PdisablePreDex --stacktrace