parameters:
- name: b2_opts
  type: string
  default: ''

steps:
- bash: |
    set -e
    uname -a
    sudo xcode-select -switch ${XCODE_APP}
    which clang++
  displayName: Install
- bash: |
    set -e
    cd src/engine
    ./build.sh ${TOOLSET}
    ./b2 -v
    cd ../..
  displayName: Build
- bash: |
    set -e
    cd test
    ./test_all.py ${TOOLSET}
    cd ..
  displayName: Test
- bash: |
    set -e
    ./src/engine/b2 b2 warnings-as-errors=on variant=debug,release ${TOOLSET:+toolset=$TOOLSET} ${{ parameters.b2_opts }}
  displayName: "No Warnings"
- bash: |
    set -e
    ./bootstrap.sh ${TOOLSET}
    ./b2 --prefix=$HOME/temp/.b2 install ${TOOLSET:+toolset=$TOOLSET} ${{ parameters.b2_opts }}
    rm ./b2
    export PATH=$HOME/temp/.b2/bin:$PATH
    cd $HOME
    touch build.jam
    b2 -v
    b2 -n --debug-configuration ${TOOLSET:+toolset=$TOOLSET} ${{ parameters.b2_opts }}
  displayName: Bootstrap
