language: java

matrix:
  # Only do docker integration tests with OpenJDK 7: the docker
  # tests are not affected by JDK on host system.
  include:
    - jdk: oraclejdk7
      env:
        - GRADLE_BUILD_TASKS="assemble dockerBuild"
        - GRADLE_SCRIPT_TASKS="clean dockerIntegrationTest check"
    - jdk: openjdk7
      env:
        - GRADLE_BUILD_TASKS="assemble"
        - GRADLE_SCRIPT_TASKS="check"
    - jdk: oraclejdk8
      env:
        - GRADLE_BUILD_TASKS="assemble"
        - GRADLE_SCRIPT_TASKS="check"
  # Stop when one of the Java versions do not work
  fast_finish: true

sudo: required

services:
  - docker

# Install documentation dependencies
addons:
  apt_packages:
    - pandoc
    - texlive
    - lmodern

# Install Docker compose
before_install:
  - curl -L https://github.com/docker/compose/releases/download/1.4.2/docker-compose-`uname -s`-`uname -m` > docker-compose
  - chmod +x docker-compose
  - sudo mv docker-compose /usr/local/bin
  - touch .docker-test-cache-set

install:
  - gradle $GRADLE_BUILD_TASKS

script:
  - gradle $GRADLE_SCRIPT_TASKS

language: java

matrix:
  # Only do docker integration tests with Oracle JDK 7: the docker
  # tests are not affected by JDK on host system.
  include:
    - jdk: oraclejdk7
      env:
        - GRADLE_BUILD_TASKS="assemble dockerBuild"
        - GRADLE_SCRIPT_TASKS="clean dockerIntegrationTest check"
      sudo: true
      services:
        - docker
    - jdk: openjdk7
      env:
        - GRADLE_BUILD_TASKS="assemble"
        - GRADLE_SCRIPT_TASKS="check"
      sudo: false
    - jdk: oraclejdk8
      env:
        - GRADLE_BUILD_TASKS="assemble"
        - GRADLE_SCRIPT_TASKS="check"
      sudo: false
  # Stop when one of the Java versions do not work
  fast_finish: true

# Install documentation dependencies
addons:
  apt_packages:
    - pandoc
    - texlive
    - lmodern

# Install Docker compose
before_install:
  - mkdir -p "$HOME/bin"
  - curl -L https://github.com/docker/compose/releases/download/1.4.2/docker-compose-`uname -s`-`uname -m` > "$HOME/bin/docker-compose"
  - chmod +x "$HOME/bin/docker-compose"
  - export PATH="$PATH:$HOME/bin"
  - touch .docker-test-cache-set

install:
  - gradle $GRADLE_BUILD_TASKS

script:
  - gradle $GRADLE_SCRIPT_TASKS

Remove sudo and docker from all packages except Oracle JDK 7
Remove sudo and docker from all packages except Oracle JDK 7
