version: 0.2.{build}
skip_tags: true
platform: Any CPU
assembly_info:
  patch: true
  file: '**\AssemblyInfo.*'
  assembly_version: '{version}'
  assembly_file_version: '{version}'
  assembly_informational_version: '{version}-{branch}'
install:
- if not exist gtk-sharp-2.12.25.msi appveyor DownloadFile http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.25.msi
- msiexec /i gtk-sharp-2.12.25.msi /qn /norestart
- if not exist gtk-sharp-2.99.3.msi appveyor DownloadFile https://download.gnome.org/binaries/win32/gtk-sharp/2.99/gtk-sharp-2.99.3.msi
- msiexec /i gtk-sharp-2.99.3.msi /qn /norestart
cache:
- gtk-sharp-2.12.25.msi
- gtk-sharp-2.99.3.msi
- packages
nuget:
  account_feed: true
  project_feed: true
  disable_publish_on_pr: true
build_script:
- nuget restore
- msbuild Xwt\Xwt.csproj /target:Build /property:Configuration=Release;Platform=AnyCPU /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild Xwt.Gtk\Xwt.Gtk.csproj /target:Build /property:Configuration=Release;Platform=AnyCPU /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild Xwt.Gtk\Xwt.Gtk3.csproj /target:Build /property:Configuration=Release;Platform=AnyCPU /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- msbuild Xwt.WPF\Xwt.WPF.csproj /target:Build /property:Configuration=Release;Platform=AnyCPU /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- mkdir nuget
- NuGet pack Xwt\Xwt.csproj -Properties "Configuration=Release;Platform=AnyCPU" -Symbols -OutputDirectory nuget
- NuGet pack Xwt.Gtk\Xwt.Gtk.csproj -Properties "Configuration=Release;Platform=AnyCPU" -Symbols -OutputDirectory nuget
- NuGet pack Xwt.Gtk\Xwt.Gtk3.csproj -Properties "Configuration=Release;Platform=AnyCPU" -Symbols -OutputDirectory nuget
- NuGet pack Xwt.WPF\Xwt.WPF.csproj -Properties "Configuration=Release;Platform=AnyCPU" -Symbols -OutputDirectory nuget
- dir nuget
test_script:
- ps: >-
    msbuild Xwt.sln /p:Configuration="Win-Debug" /p:Platform="Any Cpu" /verbosity:quiet

    nunit-console-x86.exe --framework=4.0 -domain=None -noshadow -nothread Testing\bin\WpfTestRunner.exe

    $wc = New-Object 'System.Net.WebClient'

    $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestResult.xml))

    $env:Path += ";C:\Program Files (x86)\GtkSharp\2.12\bin"

    $env:GTK_BASEPATH = "C:\Program Files (x86)\GtkSharp\2.12\"

    nunit-console-x86.exe --framework=4.0 -domain=None -noshadow -nothread Testing\bin\GtkTestRunner.exe

    $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestResult.xml))
artifacts:
- path: nuget\*.nupkg
  name: Xwt-$(APPVEYOR_BUILD_VERSION)