#   from: https://raw.githubusercontent.com/AndrewAnnex/SpiceyPy/master/appveyor.yml
# retrieved feb 2 2019

build: off

environment:
  global:
      WITH_COMPILER: "cmd /E:ON /V:ON /C .\\appveyor\\windows_sdk.cmd"

  matrix:
      - PYTHON: "C:\\Python27-x64"
        PYTHON_VERSION: "2.7.x"
        ARCH: "64"
        PLAT_NAME: "win-amd64"
        PY_TAG: "cp27"

      - PYTHON: "C:\\Python36-x64"
        PYTHON_VERSION: "3.6.x"
        ARCH: "64"
        WINDOWS_SDK_VERSION: "v7.1"
        PLAT_NAME: "win-amd64"
        PY_TAG: "cp36"

      - PYTHON: "C:\\Python37-x64"
        PYTHON_VERSION: "3.7.x"
        ARCH: "64"
        WINDOWS_SDK_VERSION: "v7.1"
        PLAT_NAME: "win-amd64"
        PY_TAG: "cp37"

platform:
  - x64

cache:
  - C:\Users\appveyor\Downloads -> setup.py

install:
  # Check that we have the expected version and architecture for Python
  - "%PYTHON%/python --version"
  - "%PYTHON%/python -c \"import struct; print(struct.calcsize('P') * 8)\""

# Log out the python version just so we know it
  - ECHO "%PYTHON_VERSION%"

  # update path to use installed pip
  - set PATH=%PYTHON%\\scripts;%PATH%

  # Download things we absolutely need
  - pip install numpy setuptools wheel

  # Now install spiceypy
  - IF "%ARCH%"=="32" (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86) ELSE (ECHO "probably a 64bit build")
  - IF "%ARCH%"=="64" (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64) ELSE (ECHO "probably a 32bit build")
  - "%PYTHON%/python setup.py develop"

  - ECHO "Installed scikit-fmm!"
  - "%PYTHON%/python -c \"import skfmm; print(skfmm.__version__)\""

test_script:
  - "%PYTHON%/python -c \"import skfmm, sys; sys.exit(skfmm.test())\""

after_test:
  - ECHO "DONE!"
  - ECHO "BUILDING WHEELS..."
  - "%PYTHON%/python setup.py sdist bdist_wheel --plat-name=%PLAT_NAME% --python-tag=%PY_TAG%"
  - "%PYTHON%/python setup.py sdist bdist_wininst"
  - ps: "ls dist"

branches:
  only:
    - master

artifacts:
  - path: dist\*
