branches:
  only:
    - /master.*/
    - /develop.*/
    - /feature\/.*/
language: cpp
script:
  - pushd src/engine
  - export CXX=${TRAVIS_COMPILER}
  - ./build.sh ${TOOLSET}
  - popd
  - pushd test
  - python test_all.py ${TOOLSET}
  - popd
  - src/engine/b2 --prefix=${HOME}/b2 install
  - ls -laFR ${HOME}/b2
stages:
  - name: test current
  - name: test previous
  - name: website update
    if: branch IN (develop,master) AND type IN (push)
dist: xenial
jobs:
  include:
    - stage: test current
      compiler: g++-8
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-8
          sources:
            - ubuntu-toolchain-r-test
    - compiler: clang++-8
      env: TOOLSET=clang
      os: linux
      addons:
        apt:
          packages:
            - clang-8
            - llvm-8-dev
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-xenial-8
    - osx_image: xcode10.1
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - stage: test previous
      compiler: g++-4.7
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-4.7
          sources:
            - ubuntu-toolchain-r-test
    - compiler: g++-4.8
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-4.8
          sources:
            - ubuntu-toolchain-r-test
    - compiler: g++-4.9
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-4.9
          sources:
            - ubuntu-toolchain-r-test
    - compiler: g++-5
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-5
          sources:
            - ubuntu-toolchain-r-test
    - compiler: g++-6
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-6
          sources:
            - ubuntu-toolchain-r-test
    - compiler: g++-7
      env: TOOLSET=gcc
      os: linux
      addons:
        apt:
          packages:
            - g++-7
          sources:
            - ubuntu-toolchain-r-test
    - compiler: clang++
      env: TOOLSET=clang
      os: linux
      dist: precise
      addons:
        apt:
          packages:
            - clang-3.4
    - compiler: clang++-3.5
      env: TOOLSET=clang
      os: linux
      dist: trusty
      addons:
        apt:
          packages:
            - clang-3.5
            - libstdc++-4.9-dev
          sources:
            - ubuntu-toolchain-r-test
    - compiler: clang++-3.6
      env: TOOLSET=clang
      os: linux
      dist: trusty
      addons:
        apt:
          packages:
            - clang-3.6
            - libstdc++-4.9-dev
          sources:
            - ubuntu-toolchain-r-test
    - compiler: clang++-3.7
      env: TOOLSET=clang
      os: linux
      dist: precise
      addons:
        apt:
          packages:
            - clang-3.7
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-precise-3.7
    - compiler: clang++-3.8
      env: TOOLSET=clang
      os: linux
      dist: trusty
      addons:
        apt:
          packages:
            - clang-3.8
            - libstdc++-4.9-dev
          sources:
            - ubuntu-toolchain-r-test
    - compiler: clang++-3.9
      env: TOOLSET=clang
      os: linux
      dist: trusty
      addons:
        apt:
          packages:
            - clang-3.9
            - libstdc++-4.9-dev
          sources:
            - ubuntu-toolchain-r-test
    - compiler: clang++-4.0
      env: TOOLSET=clang
      os: linux
      addons:
        apt:
          packages:
            - clang-4.0
            - llvm-4.0-dev
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-xenial-4.0
    - compiler: clang++-5.0
      env: TOOLSET=clang
      os: linux
      addons:
        apt:
          packages:
            - clang-5.0
            - llvm-5.0-dev
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-xenial-5.0
    - compiler: clang++-6.0
      env: TOOLSET=clang
      os: linux
      addons:
        apt:
          packages:
            - clang-6.0
            - llvm-6.0-dev
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-xenial-6.0
    - compiler: clang++-7
      env: TOOLSET=clang
      os: linux
      addons:
        apt:
          packages:
            - clang-7
            - llvm-7-dev
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-xenial-7
    - osx_image: xcode10
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode9.4
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode9.3
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode9.2
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode9.1
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode9
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode8.3
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode8
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - osx_image: xcode7.3
      os: osx
      env: TOOLSET=clang
      compiler: clang
    - stage: website update
      os: linux
      script:
        - gem install asciidoctor
        - gem install pygments.rb
        - pip install --user Pygments
        - pip install --user https://github.com/bfgroup/jam_pygments/archive/master.zip
        - git config user.email "b2-bot"
        - git config user.name "b2-bot"
        - echo "using asciidoctor ;" >> project-config.jam
        - pushd src/engine
        - ./build.sh
        - popd
        - ./bootstrap.sh --with-toolset=${TOOLSET}
        - pushd doc
        - ../b2 --website-doc-dir=manual/${TRAVIS_BRANCH} website
