version: '{build}'

shallow_clone: true

os:
  - Windows Server 2012

platform:
  # As far as I can tell, Win32 is actually 64-bit!!!
  #- Win32
  - x64

environment:
  global:
    MB_SLOW_TEST_TIMEOUT: 45000

  matrix:
    # Appveyor doesn't give us a way of explicitly defining each node in the matrix like Travis does,
    # so we'll encode the information in a single environment variable and decode it in the install section
    - MB_APPVEYOR_CONFIG: "NODE_VERSION=0.12|MB_GRUNT_TASK=test:zip"
    - MB_APPVEYOR_CONFIG: "NODE_VERSION=0.10|MB_GRUNT_TASK=default|MB_SKIP_x86=true"
    - MB_APPVEYOR_CONFIG: "NODE_VERSION=0.12|MB_GRUNT_TASK=default|MB_SKIP_x86=true"
    - MB_APPVEYOR_CONFIG: "NODE_VERSION=4.4|MB_GRUNT_TASK=default|MB_SKIP_x86=true"
    - MB_APPVEYOR_CONFIG: "NODE_VERSION=5.10|MB_GRUNT_TASK=default|MB_SKIP_x86=true"

cache:
  - node_modules -> package.json

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

install:
  - ps: |
          ForEach ($var in (Get-ChildItem env:MB_APPVEYOR_CONFIG).Value.Split("|")) {
              $key = $var.Split("=")[0]
              $value = $var.Split("=")[1];
              Set-Item env:$key $value
          }
  - ps: Install-Product node $env:NODE_VERSION

build_script:
  - node --version && npm --version
  - build.bat %MB_GRUNT_TASK%

test: off
