# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc

jobs:
- job: Linux
  pool:
    vmImage: 'Ubuntu 16.04'

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.6'
      architecture: 'x64'

  - script: python -m pip install --upgrade pip setuptools wheel
    displayName: 'Install Python tools'

  - script: |
      pip install conan
      conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
    displayName: 'Install & configure Conan'

  - script: |
      conan install . -i build -s build_type=Release -e FBXSDK_SDKS=sdk
    displayName: 'Resolve binary dependencies and build CMake files.'

  - script: |
      conan build -bf build .
      mv build/FBX2glTF build/FBX2glTF-linux-x64
    displayName: 'Build FBX2glTF'

  - task: PublishBuildArtifacts@1
    inputs:
      pathtoPublish: 'build/FBX2glTF-linux-x64'
      artifactName: 'binaries'

- job: Mac
  pool:
    vmImage: 'macOS-10.14'

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.6'
      architecture: 'x64'

  - script: python -m pip install --upgrade pip setuptools wheel
    displayName: 'Install Python tools'

  - script: |
      pip install conan
      conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
    displayName: 'Install Conan'

  - script: |
      conan install . -i build -s compiler=apple-clang -s compiler=apple-clang -s compiler.version=10.0 -s compiler.libcxx=libc++ -s build_type=Release -e FBXSDK_SDKS=sdk
    displayName: 'Resolve binary dependencies and build CMake files.'

  - script: |
      conan build -bf build .
      mv build/FBX2glTF build/FBX2glTF-darwin-x64
    displayName: 'Build FBX2glTF'

  - task: PublishBuildArtifacts@1
    inputs:
      pathtoPublish: 'build/FBX2glTF-darwin-x64'
      artifactName: 'binaries'

- job: Windows
  pool:
    vmImage: 'vs2017-win2016'

  steps:
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '3.6'
      architecture: 'x64'

  - script: python -m pip install --upgrade pip setuptools wheel
    displayName: 'Install Python tools'

  - script: |
      pip install conan
      conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
    displayName: 'Install Conan'

  - script: |
      conan install . -i build -s build_type=Release -e FBXSDK_SDKS=sdk
    displayName: 'Resolve binary dependencies and build CMake files.'

  - script: |
      conan build -bf build .
      move build\Release\FBX2glTF.exe build\Release\FBX2glTF-windows-x64.exe
    displayName: 'Build FBX2glTF'

  - task: PublishBuildArtifacts@1
    inputs:
      pathtoPublish: 'build/Release/FBX2glTF-windows-x64.exe'
      artifactName: 'binaries'
