language: android
android:
  components:
    - platform-tools
    - tools

    # The BuildTools version used by your project
    - build-tools-25.0.1
    - android-25
    - extra-android-m2repository
    - extra-google-m2repository
    - extra-android-support
    - extra-google-google_play_services

  licenses:
    - android-sdk-license-.+
    - '.+'

jdk:
  - oraclejdk8

before_script:
  - chmod +x gradlew

before_install:
  - mkdir "$ANDROID_HOME/licenses" || true
  - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
  - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"

#Build, and run tests
script: "./gradlew clean buildStandardDebug"
sudo: false

before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
env:
  - GRADLE_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m"