version: 1.0.{build}

image: Visual Studio 2017

environment:
  matrix:
  - generator: "Visual Studio 15"
    config: Release
    arch: vs2017-x86
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

  - generator: "Visual Studio 15 Win64"
    config: Release
    arch: vs2017-x64
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

  - generator: "Visual Studio 14"
    config: Release
    arch: vs2015-x86
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

  - generator: "Visual Studio 14 Win64"
    config: Release
    arch: vs2015-x64
    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

init:
  - git config --global core.autocrlf input

build_script:
  - cmake -G"%generator%" -H. -Bbuild
  #- cmake --build build --config "%config%"
  - msbuild build\humextra.sln /t:build /p:Configuration="%config%" /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

after_build:
  - ps: $env:git_hash = $env:appveyor_repo_commit.Substring(0, 8)
  - ps: $env:my_version = "$env:appveyor_build_version-$env:git_hash"
  - set package_name=humextra-%my_version%-%arch%
  - mkdir lib
  - copy "build\%config%\humextra.lib" lib
  - 7z a %package_name%.zip include lib README.md LICENSE.txt

artifacts:
  - path: $(package_name).zip
    name: $(arch)



