version: '{build}'
image: Visual Studio 2019
pull_requests:
  do_not_increment_build_number: true
init:
cache:
  - vcpkg -> CMake/VcpkgDeps.cmake, scripts/build_vcpkg_deps.ps1
configuration: Release
before_build:
  - cmd: cmake -G "Visual Studio 16 2019" -DUSE_VCPKG_DEPS=ON -DENABLE_UNIT_TESTS=ON .
build:
  project: CorsixTH_Top_Level.sln
  verbosity: minimal

test_script:
  - cd CorsixTH
  - cmd: ctest -VV -C Release
  - cd ..

after_build:
- cp -R %APPVEYOR_BUILD_FOLDER%/CorsixTH/Lua %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/Lua
- cp -R %APPVEYOR_BUILD_FOLDER%/CorsixTH/Bitmap %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/Bitmap
- cp -R %APPVEYOR_BUILD_FOLDER%/CorsixTH/Levels %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/Levels
- cp -R %APPVEYOR_BUILD_FOLDER%/CorsixTH/Campaigns %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/Campaigns
- cp %APPVEYOR_BUILD_FOLDER%/CorsixTH/CorsixTH.lua %APPVEYOR_BUILD_FOLDER%/CorsixTH/Release/
artifacts:
- path: CorsixTH/Release/
  name: CorsixTH
