version: 0.1.{build}
environment:
  MAVEN_SERVER_USERNAME:
    secure: e08wzRaJqCfWF+u2FUVjrQ==
  MAVEN_SERVER_PASSWORD:
    secure: WwLee6S3XIBtsV8RqH4MdA==
configuration:
  - Release
platform:
  - x64
build:
  project: jxrencoderdecoder\JXR_vc14.sln
  verbosity: minimal
install:
  - cinst swig
before_build:
  - mkdir java\target\swig\ome\jxrlib
  - swig.exe -java -c++ -package ome.jxrlib -outdir java\target\swig\ome\jxrlib -o java\target\swig\JXR_wrap.cxx java\JXR.i
after_build:
  - mvn -f java\native-windows_64\pom.xml package
on_success:
  - IF NOT EXIST C:\Users\appveyor\.m2 mkdir C:\Users\appveyor\.m2
  - ps: (Get-Content java\settings.xml) -replace '__MAVEN_SERVER_USERNAME__', "$env:MAVEN_SERVER_USERNAME" | %{$_ -replace '__MAVEN_SERVER_PASSWORD__', "$env:MAVEN_SERVER_PASSWORD"} | Out-File -encoding ASCII C:\Users\appveyor\.m2\settings.xml
  - mvn -f java/pom.xml -DargLine="-Djava.library.path=vc14projects\Release\JXRJava\x64" test
  - IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER mvn -f java\native-windows_64\pom.xml deploy
artifacts:
  - path: 'java\native-windows_64\target\*.jar'
cache:
# Don't repopulate the entire Maven repository every time we build
  - C:\Users\appveyor\.m2\repository
