# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2019.

trigger:
  branches:
    include:
    - develop
    - master
    - feature/*
pr:
  branches:
    include:
    - develop

variables:
  AZP: 1
  AZP_REPO_DIR: $(Build.Repository.LocalPath)
  AZP_BRANCH: $(Build.SourceBranch)
  AZP_COMMIT: $(Build.SourceVersion)
  AZP_REPO: $(Build.Repository.Name)
  AZP_PULL_REQUEST: $(System.PullRequest.PullRequestNumber)

jobs:

- job: 'Linux'
  pool:
    vmImage: 'ubuntu-16.04'
  strategy:
    matrix:
      GCC 8 (GNU):
        TOOLSET: gcc-8
        CXXSTD: 03,11,14,17,2a
        CXXDIALECT: gnu
      GCC 8 (ISO):
        TOOLSET: gcc-8
        CXXSTD: 03,11,14,17,2a
      GCC 7:
        TOOLSET: gcc-7
      GCC 6:
        TOOLSET: gcc-6
      GCC 5:
        TOOLSET: gcc-5
      GCC 4.9:
        TOOLSET: gcc-4.9
      GCC 4.8:
        TOOLSET: gcc-4.8
      GCC 4.7:
        TOOLSET: gcc-4.7
      Clang 8:
        TOOLSET: clang-8
      Clang 7:
        TOOLSET: clang-7
      Clang 6:
        TOOLSET: clang-6.0
      Clang 5:
        TOOLSET: clang-5.0
      Clang 4:
        TOOLSET: clang-4.0
      Clang 3.9:
        TOOLSET: clang-3.9
      Clang 3.8:
        TOOLSET: clang-3.8
      Clang 3.7:
        TOOLSET: clang-3.7
      Clang 3.6:
        TOOLSET: clang-3.6
      Clang 3.5:
        TOOLSET: clang-3.5
  steps:
  - task: UsePythonVersion@0
  - script: python tools/ci/library_test.py install
    failOnStderr: false
    displayName: Install
  - script: python tools/ci/library_test.py script
    failOnStderr: false
    displayName: Test

- job: 'macOS'
  strategy:
    matrix:
      Xcode 10.1:
        TOOLSET: xcode-10.1
        XCODE_APP: /Applications/Xcode_10.1.app
        VM_IMAGE: 'macOS-10.14'
      Xcode 10.0:
        TOOLSET: xcode-10.0
        XCODE_APP: /Applications/Xcode_10.app
        VM_IMAGE: 'macOS-10.14'
      Xcode 9.4.1:
        TOOLSET: xcode-9.4.1
        XCODE_APP: /Applications/Xcode_9.4.1.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.4:
        TOOLSET: xcode-9.4
        XCODE_APP: /Applications/Xcode_9.4.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.3.1:
        TOOLSET: xcode-9.3.1
        XCODE_APP: /Applications/Xcode_9.3.1.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.3:
        TOOLSET: xcode-9.3
        XCODE_APP: /Applications/Xcode_9.3.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.2:
        TOOLSET: xcode-9.2
        XCODE_APP: /Applications/Xcode_9.2.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.1:
        TOOLSET: xcode-9.1
        XCODE_APP: /Applications/Xcode_9.1.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.0.1:
        TOOLSET: xcode-9.0.1
        XCODE_APP: /Applications/Xcode_9.0.1.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 9.0:
        TOOLSET: xcode-9.0
        XCODE_APP: /Applications/Xcode_9.app
        VM_IMAGE: 'macOS-10.13'
      Xcode 8.3.3:
        TOOLSET: xcode-8.3
        XCODE_APP: /Applications/Xcode_8.3.3.app
        VM_IMAGE: 'macOS-10.13'
  pool:
    vmImage: $(VM_IMAGE)
  steps:
  - task: UsePythonVersion@0
  - script: sudo xcode-select -switch ${XCODE_APP}
    failOnStderr: false
    displayName: Xcode Select
  - script: python tools/ci/library_test.py install
    failOnStderr: false
    displayName: Install
  - script: python tools/ci/library_test.py script
    failOnStderr: false
    displayName: Test

- job: 'Windows'
  strategy:
    matrix:
      VS 2019:
        TOOLSET: vs-2019
        ADDRESS_MODEL: 32,64
        CXXSTD: 14,latest
        VM_IMAGE: 'windows-2019'
      VS 2019 (UWP DESKTOP):
        TOOLSET: vs-2019
        ADDRESS_MODEL: 64
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
        VM_IMAGE: 'windows-2019'
      VS 2019 (UWP PHONE):
        TOOLSET: vs-2019
        ADDRESS_MODEL: 64
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
        VM_IMAGE: 'windows-2019'
      VS 2019 (UWP STORE):
        TOOLSET: vs-2019
        ADDRESS_MODEL: 64
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_PC_APP
        VM_IMAGE: 'windows-2019'
      VS 2019 (UWP SERVER):
        TOOLSET: vs-2019
        ADDRESS_MODEL: 64
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_SERVER
        VM_IMAGE: 'windows-2019'
      VS 2019 (UWP SYSTEM):
        TOOLSET: vs-2019
        ADDRESS_MODEL: 64
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_SYSTEM
        VM_IMAGE: 'windows-2019'
      VS 2017:
        TOOLSET: vs-2017
        VM_IMAGE: 'vs2017-win2016'
      VS 2015:
        TOOLSET: vs-2015
        VM_IMAGE: 'vs2015-win2012r2'
      VS 2013:
        TOOLSET: vs-2013
        VM_IMAGE: 'vs2015-win2012r2'
      MinGW 8.1.0:
        TOOLSET: mingw-8
        VM_IMAGE: 'vs2017-win2016'
      MinGW 8.1.0 (UWP DESKTOP):
        TOOLSET: mingw-8
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
        VM_IMAGE: 'vs2017-win2016'
      MinGW 8.1.0 (UWP STORE):
        TOOLSET: mingw-8
        CXXDEFS: _WIN32_WINNT=0x0A00,WINAPI_FAMILY=WINAPI_FAMILY_PC_APP
        VM_IMAGE: 'vs2017-win2016'
  pool:
    vmImage: $(VM_IMAGE)
  steps:
  - script: python tools/ci/library_test.py install
    failOnStderr: false
    displayName: Install
  - script: python tools/ci/library_test.py script
    failOnStderr: false
    displayName: Test
