trigger:
  - master

jobs:
  - job: vcpkg
    timeoutInMinutes: 30

    pool:
      vmImage: 'vs2017-win2016'

    steps:

      - task: Bash@3
        inputs:
          script: |
            git submodule update --init --recursive
          workingDirectory: '$(system.defaultWorkingDirectory)'
          targetType: inline

      - task: Bash@3
        inputs:
          script: |
            git clone https://github.com/Microsoft/vcpkg.git
            cd vcpkg
            ./bootstrap-vcpkg.bat
            ./vcpkg install curl libzip[core] spdlog boost-program-options --triplet x64-windows
          workingDirectory: '$(system.defaultWorkingDirectory)'
          targetType: inline

      - task: CMake@1
        inputs:
          workingDirectory: '$(system.defaultWorkingDirectory)/cmake-build-release'
          cmakeArgs: 'cmake -G "CodeBlocks - NMake Makefiles" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe" -DCMAKE_TOOLCHAIN_FILE=../../../vcpkg/scripts/buildsystems/vcpkg.cmake -DFMI4CPP_WITH_ODEINT=OFF'

      - task: CMake@1
        inputs:
          workingDirectory: '$(system.defaultWorkingDirectory)/cpp/FMU-proxy/cmake-build-release'
          cmakeArgs: '--build . --target all'


  - job: conan
    timeoutInMinutes: 30

    pool:
      vmImage: 'vs2017-win2016'

    steps:

      - task: Bash@3
        inputs:
          script: |
            git submodule update --init --recursive
          workingDirectory: '$(system.defaultWorkingDirectory)'
          targetType: inline

      - task: Bash@3
        inputs:
          script: |
            python -m pip install --upgrade pip
            pip install conan --upgrade
            conan remote add bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"
            conan install . -s build_type=Release --install-folder=cmake-build-release
          workingDirectory: '$(system.defaultWorkingDirectory)/cpp/FMU-proxy'
          targetType: inline

      - task: CMake@1
        inputs:
          workingDirectory: '$(system.defaultWorkingDirectory)/cpp/FMU-proxy/cmake-build-release'
          cmakeArgs: 'cmake -G "Visual Studio 15 2017 Win64" .. -DFMI4CPP_USING_CONAN=ON'

      - task: VSBuild@1
        inputs:
          solution: '$(system.defaultWorkingDirectory)/cmake-build-release/*.sln'
          configuration: 'release'
          platform: 'x64'

Set up CI with Azure Pipelines
Set up CI with Azure Pipelines