# use Docker-based container (instead of OpenVZ)
sudo: false

language: scala

before_install:
  # using jabba for custom jdk management
  - curl -sL https://git.io/jabba | bash && . ~/.jabba/jabba.sh
  - jabba install adopt@1.8.212-03
  - jabba install adopt@1.11.0-3

script:
  - jabba use $JDK
  - java -version
  - sbt ++$TRAVIS_SCALA_VERSION test doc

jobs:
  include:
  - env: JDK=adopt@1.8.212-03
  - env: JDK=adopt@1.11.0-3

before_cache:
  # Remove to avoid unnecessary cache updates
  - find $HOME/.sbt -name "*.lock" -delete
  - find $HOME/.ivy2 -name "ivydata-*.properties" -delete

cache:
  directories:
    - $HOME/.ivy2/cache
    - $HOME/.sbt/boot
    - $HOME/.jabba/jdk