language: android
matrix:
  include:
    - jdk: oraclejdk8
      env: TEST=java
    - jdk: openjdk7
      env: TEST=java
    - jdk: openjdk7
      env: TEST=android
      dist: precise
android:
  components:
    - android-16
    - build-tools-21.1.1
    - extra-android-m2repository
    - sys-img-armeabi-v7a-android-16
script:
  - 'if [ $TEST = java ]; then mvn test -Dsurefire.useFile=false; fi'
  - 'if [ $TEST = android ]; then mvn install -DskipTests && cd commonmark-android-test && travis_retry ./.travis.sh; fi'

after_success: |
  if [ $TRAVIS_JDK_VERSION = oraclejdk8 ] && [ $TEST = java ]; then
    # Calculate test coverage
    mvn clean test jacoco:report -Pcoverage
    bash <(curl -s https://codecov.io/bash)
  fi

language: android

matrix:
  include:
    - jdk: oraclejdk8
      env: TEST=java
    - jdk: openjdk7
      env: TEST=java
    - jdk: openjdk7
      env: TEST=android
      dist: precise
      android:
        components:
          - android-16
          - build-tools-21.1.1
          - extra-android-m2repository
          - sys-img-armeabi-v7a-android-16

  allow_failures:
    - env: TEST=android

script:
  - 'if [ $TEST = java ]; then mvn test -Dsurefire.useFile=false; fi'
  - 'if [ $TEST = android ]; then mvn install -DskipTests && cd commonmark-android-test && travis_retry ./.travis.sh; fi'

after_success: |
  if [ $TRAVIS_JDK_VERSION = oraclejdk8 ] && [ $TEST = java ]; then
    # Calculate test coverage
    mvn clean test jacoco:report -Pcoverage
    bash <(curl -s https://codecov.io/bash)
  fi

Allow Android build to fail
Allow Android build to fail

It's flakey because it times out waiting for the emulator to start,
rerunning it fixes it most of the times.
