version: '2.4.{build}'

# branches to build
branches:
  # whitelist
  only:
    - master

image:
- Visual Studio 2017

environment: 
  matrix:
    # Win32/x64/Debug
    - platform: x64
      configuration: Debug
      cmake_args:
      
    # Win32/x64/Release
    - platform: x64
      configuration: Release
      cmake_args:

    # Win32-8.1SDK/x64/Release
    - platform: x64
      configuration: Release
      cmake_args: -D CMAKE_SYSTEM_VERSION=8.1

    # UWP/x64/Debug
    - platform: x64
      configuration: Debug
      cmake_args: -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0

    # UWP/x64/Release
    - platform: x64
      configuration: Release
      cmake_args: -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0

    # Win32/x86/Release
    - platform: Win32
      configuration: Release
      cmake_args:

    # UWP/x86/Release
    - platform: Win32
      configuration: Release
      cmake_args: -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0

# clone directory
clone_folder: c:\projects\diligentengine

install:
  # clone submodules
  - git submodule update --init --recursive
  - DiligentCore\BuildTools\Scripts\appveyor\install.bat
 
before_build:
  - cd c:\projects\diligentengine\DiligentCore\BuildTools\FormatValidation
  - validate_format_win.bat
  - cd c:\projects\diligentengine\DiligentTools\BuildTools\FormatValidation
  - validate_format_win.bat
  - cd c:\projects\diligentengine\DiligentFX\BuildTools\FormatValidation
  - validate_format_win.bat
  - cd c:\projects\diligentengine\DiligentSamples\BuildTools\FormatValidation
  - validate_format_win.bat
  - cd c:\projects\diligentengine
  - echo %PLATFORM%
  - echo.%cmake_args%
  - cmake -D DILIGENT_ENABLE_TESTS=TRUE %cmake_args% -S . -B ./build -G "Visual Studio 15 2017" -A %PLATFORM%

build:
  project: c:\projects\diligentengine\build\DiligentEngine.sln
  verbosity: minimal
  parallel: true
