jdk: oraclejdk8
language: scala

matrix:
  include:
  - scala: 2.12.8
  - scala: 2.13.0-M5
    script:
    # TODO scalatags for Scala 2.13.0-M4
    - sbt "++ ${TRAVIS_SCALA_VERSION}!" test

language: scala

before_install:
  # adding $HOME/.sdkman to cache would create an empty directory, which interferes with the initial installation
  - "[[ -d $HOME/.sdkman/bin ]] || rm -rf $HOME/.sdkman/"
  - curl -sL https://get.sdkman.io | bash
  - echo sdkman_auto_answer=true > "$HOME/.sdkman/etc/config"
  - source "$HOME/.sdkman/bin/sdkman-init.sh"

install:
  - sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1)
  - unset JAVA_HOME
  - java -Xmx32m -version
  - javac -J-Xmx32m -version

matrix:
  include:
  - scala: 2.12.8
    env:
      - ADOPTOPENJDK=8
  - scala: 2.13.0-M5
    env:
      - ADOPTOPENJDK=8
    script:
    # TODO scalatags for Scala 2.13.0-M4
    - sbt "++ ${TRAVIS_SCALA_VERSION}!" test

Use SDKMAN to install openjdk that is more robust on Travis update
Use SDKMAN to install openjdk that is more robust on Travis update
