dist: trusty

language: java
jdk:
  - openjdk11

install: skip

jobs:
    include:
      - env: MODE=current_11
        script:
            - set -e
            - ./gradle/scripts/check-generateLogic-committed.sh
            - ./gradlew buildAllWithoutJs
            - misc/tools/atrium-scala2-test/gradlew -p ./misc/tools/atrium-scala2-test build
        after_success: bash <(curl -s https://codecov.io/bash) -F current

      - env: MODE=current_8
        jdk: oraclejdk8
        script: ./gradlew buildNonDeprecatedJvm buildAllAndroid

      - env: MODE=js
        script: ./gradlew buildAllJs

      - env: MODE=bc
        script: ./gradlew bcTests
        after_success: bash <(curl -s https://codecov.io/bash) -F bc

      - env: MODE=bbc
        script: ./gradlew bbcTests
        after_success: bash <(curl -s https://codecov.io/bash) -F bbc

      - env: MODE=samples
        script:
            - set -e
            - samples/js/gradlew -p ./samples/js build
            - samples/jvm/spek/gradlew -p ./samples/jvm/spek build
            - samples/jvm/junit5/gradlew -p ./samples/jvm/junit5 build
            # in case of travis problems installing jdk11
            #- cd samples/maven && ./mvnw -B test -Djava.version=1.8 && cd ../..
            - cd samples/maven && ./mvnw -B test && cd ../..
            - samples/multiplatform/gradlew -p ./samples/multiplatform build
            - misc/tools/atrium-samples-test/gradlew -p ./misc/tools/atrium-samples-test build
            - misc/tools/atrium-js-sample-test/gradlew -p ./misc/tools/atrium-js-sample-test build

before_cache:
    - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
    - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
    directories:
        - $HOME/.gradle/wrapper/
        - $HOME/.gradle/caches/
        - $HOME/.m2
        - ./gradle/node_modules
