language: java

os:
    - linux
    - osx

matrix:
    include:
        - os: linux
        jdk: oraclejdk8
        - os: osx
        osx_image: xcode8

script:
    - chmod u+x ./gradlew
    - ./gradlew build

matrix:
    include:
        - os: linux
          jdk: oraclejdk8
          before_script:
              - chmod u+x gradlew
          script:
              - ./gradlew build
        - os: osx
          osx_image: xcode8
          before_script:
              - chmod u+x gradlew
          script:
              - ./gradlew build

Move everything into Matrix configuration
Move everything into Matrix configuration
