dist: trusty

language: android

jdk:
  - oraclejdk8

android:
  components:

    # All the build system components should be at the latest version
    - tools
    - platform-tools
    - tools
    # Note that the tools section appears twice on purpose as it’s required
    # to get the newest Android SDK tools. Source: Travis CI docs.
    - build-tools-29.0.3
    - android-29

    # The libraries we can't get from Maven Central or similar
    - extra

branches:
  except:
  - /^v\..*$/ # Exclude version tags

notifications:
  email: true

before_script:

  # Ensure Gradle wrapper is executable
  - chmod +x gradlew

  # Ensure signing configuration is present
  - mv app/gradle.properties.example app/gradle.properties

  # Reduce memory usage / avoid OutOfMemoryError with Gradle 4.10.3
  - echo "org.gradle.jvmargs=-Xmx2048m -Xms512m -XX:MaxPermSize=768m" >> gradle.properties

script:
  - ./gradlew clean test assembleDebug

addons:
  # Fix OpenJDK builds
  # https://github.com/travis-ci/travis-ci/issues/5227
  hostname: short-hostname

dist: trusty

language: android

jdk:
  - oraclejdk8

android:
  components:

    # All the build system components should be at the latest version
    - tools
    - platform-tools
    - tools
    # Note that the tools section appears twice on purpose as it’s required
    # to get the newest Android SDK tools. Source: Travis CI docs.
    - build-tools-29.0.3

    # The libraries we can't get from Maven Central or similar
    - extra

branches:
  except:
  - /^v\..*$/ # Exclude version tags

notifications:
  email: true

before_install:
- yes | sdkmanager "platforms;android-29"

before_script:

  # Ensure Gradle wrapper is executable
  - chmod +x gradlew

  # Ensure signing configuration is present
  - mv app/gradle.properties.example app/gradle.properties

  # Reduce memory usage / avoid OutOfMemoryError with Gradle 4.10.3
  - echo "org.gradle.jvmargs=-Xmx2048m -Xms512m -XX:MaxPermSize=768m" >> gradle.properties

script:
  - ./gradlew clean test assembleDebug

addons:
  # Fix OpenJDK builds
  # https://github.com/travis-ci/travis-ci/issues/5227
  hostname: short-hostname

Prepare Travis CI configuration for future Android SDK versions.
Prepare Travis CI configuration for future Android SDK versions.

+ As of Android SDK version 30 the "android-xx" option fails. The build
  fails installing the SDK version.

  Error message:
  Failed to install the following Android SDK packages as some licences
  have not been accepted.
           platforms;android-30 Android SDK Platform 30
