os: Visual Studio 2019

environment:
  global:
    BITS: 32
  matrix:
    - CONFIGURATION: Release
      COMPILER: MinGW
      PLATFORM: i686

build:
  project: ponyprog.pro
  parallel: true
  verbosity: detailed

clone_script:
  - set REPO_NAME=%APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME%
  - set REPO_BRANCH=%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%
  - set REPO_COMMIT=%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%
  - if "%REPO_NAME%"=="" set REPO_NAME=%APPVEYOR_REPO_NAME%
  - if "%REPO_BRANCH%"=="" set REPO_BRANCH=%APPVEYOR_REPO_BRANCH%
  - if "%REPO_COMMIT%"=="" set REPO_COMMIT=%APPVEYOR_REPO_COMMIT%
  - cmd: >-
      git clone -q --branch=%REPO_BRANCH% https://github.com/%REPO_NAME%.git %APPVEYOR_BUILD_FOLDER%
      && git log --oneline -n 5
      && cd %APPVEYOR_BUILD_FOLDER%
      && git checkout -qf %REPO_COMMIT%
      && git submodule update --init --recursive

install:
  #- appveyor DownloadFile "https://downloads.sourceforge.net/project/picusb/libftdi1-1.4git_devkit_x86_x64_14June2018.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpicusb%2Ffiles%2Flibftdi1-1.4git_devkit_x86_x64_14June2018.zip%2Fdownload&ts=1610734013" -FileName "C:\libftdi1-1.4git_devkit_x86_x64_14June2018.zip"
  - appveyor DownloadFile "https://downloads.sourceforge.net/project/picusb/libftdi1-1.5_devkit_x86_x64_19July2020.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpicusb%2Ffiles%2Flibftdi1-1.5_devkit_x86_x64_19July2020.zip%2Fdownload&ts=1613518002" -FileName "C:\libftdi1-1.5_devkit_x86_x64_19July2020.zip"
  - 7z x -y "C:\libftdi1-1.5_devkit_x86_x64_19July2020.zip" -o"C:\"
  - if [%PLATFORM%]==[x86_64] set BITS=64
  - if [%PLATFORM%]==[x86_64] set EXTRA_OPTS=--disable-32bit

build_script:
  - echo %PATH%
  - dir "%INNOPATH%"
  - dir "C:\libftdi1-1.5_devkit_x86_x64_19July2020"
  - dir "C:\Libraries\boost_1_83_0"
  - create_inno_package.bat

after_build:
  - 7z a ponyprog.zip distribution/innosetup/Output/PonyProg*.exe

artifacts:
  - path: ponyprog.zip
    name: Ponyprog
