version: '{build}'
image: Visual Studio 2017
install:
  - cinst ant
  - refreshenv
build_script:
  - ant compile dist distmac checkstyle pmd spotbugs
test_script:
  - ant test-unit-hardfail
on_finish:
  - ps: |
        $wc = New-Object 'System.Net.WebClient'
        Get-ChildItem . -Name -Recurse 'TEST-*.xml'  |
        Foreach-Object {
            $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $_))
        }
artifacts:
  - path: dist\josm-custom.*
  - path: checkstyle-josm.xml
  - path: pmd-josm.xml
  - path: spotbugs-josm.xml
  - path: test\report
    type: zip
  - path: hs_err_pid*.log
