language: java

matrix:
  include:
    - jdk: openjdk8
      env: TARGET=checkstyle
    - jdk: openjdk8
      env: TARGET=pmd
    - jdk: openjdk8
      env: TARGET=cpd
    - jdk: openjdk8
      env: TARGET=test
      services: xvfb
    - jdk: openjdk11
      env: TARGET=test
      services: xvfb
    - os: osx
      osx_image: xcode9.2
      env: TARGET=test

before_install:
  - if [ $TARGET = test ]; then
        if [ $TRAVIS_OS_NAME = osx ]; then
            brew update; brew install clasp;
        else
            sudo apt-get -qq update; sudo apt-get install -y clasp;
        fi
    fi
install:
  - ./gradlew assemble

script:
  - ./gradlew $TARGET
  - if [ $TARGET = test ]; then ./ci/run.sh; fi

after_success:
  - if [ $TARGET = test -a $TRAVIS_JDK_VERSION = openjdk8 ]; then ./gradlew coveralls; fi

language: java

matrix:
  include:
    - jdk: openjdk8
      env: TARGET=checkstyle
    - jdk: openjdk8
      env: TARGET=pmd
    - jdk: openjdk8
      env: TARGET=cpd
    - jdk: openjdk8
      env: TARGET=test
      services: xvfb
    - jdk: openjdk11
      env: TARGET=test
      services: xvfb
    - os: osx
      osx_image: xcode11
      env: TARGET=test

addons:
  apt:
    packages: clasp
  homebrew:
    packages: clasp

install:
  - ./gradlew assemble

script:
  - ./gradlew $TARGET
  - if [ $TARGET = test ]; then ./ci/run.sh; fi

after_success:
  - if [ $TARGET = test -a $TRAVIS_JDK_VERSION = openjdk8 ]; then ./gradlew coveralls; fi

Use Travis addons for installing Clasp
Use Travis addons for installing Clasp
