language: java

jdk:
  - openjdk7
  - oraclejdk7
  - oraclejdk8

script:
  - ./gradlew test
  - if [ "$TRAVIS_JDK_VERSION" == "openjdk7" ]; then ./gradlew checkstyle; fi

after_success:
  - if [ "$TRAVIS_JDK_VERSION" == "openjdk7" ]; then ./gradlew coveralls; fi

language: java

matrix:
  include:
    - jdk: openjdk7
      env: TARGET=checkstyle
    - jdk: openjdk7
      env: TARGET=cpd
    - jdk: openjdk7
      env: TARGET=test
    - jdk: oraclejdk7
      env: TARGET=test
    - jdk: oraclejdk8
      env: TARGET=test

install:
  - ./gradlew assemble

script:
  - ./gradlew $TARGET

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

Use a matrix to separate jobs
CI: Use a matrix to separate jobs

Fixes #463.
