########################################################
##               MASTER                               ##
########################################################
-
  branches:
    only:
      - master

  image: 
    - Visual Studio 2017
    - Ubuntu
  configuration:
    - Debug
    - Release
  platform: AnyCPU
  version: 1.4.1.{build}
  clone_depth: 1
  
  skip_commits:
    files:
      - docs/*
      - LICENSE
      - README.md
      - .travis.yml
      - codecov.yml
      - .gitignore
      
  cache:
    - packages -> **\packages.config, **\*.csproj, build.ps1 #local nuget folder
#    - '%HOMEDRIVE%%HOMEPATH%\.nuget\packages -> **\packages.config, **\*.csproj, build.ps1' #global nuget folder
    - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml, after_test_fx_core.ps1'
    - '%PROGRAMDATA%\chocolatey\bin -> before_build_docfx.ps1, after_test_fx_core.ps1' #chocolatey native
    - '%PROGRAMDATA%\chocolatey\lib -> before_build_docfx.ps1, after_test_fx_core.ps1' #chocolatey portable
    - '$HOME/.local/share/NuGet/v3-cache' #nuget cache ubuntu
    - '$HOME/.local/share/NuGet/Cache' #nuget cache ubuntu
    - '%LocalAppData%\NuGet\Cache' #v>3 nuget cache windows
    - '%LocalAppData%\NuGet\v3-cache' #nuget cache windows
  
  environment:
    COVERALLS_REPO_TOKEN:  
       secure: q5xCVqG+/0ByXEFTGYgf1lCWwrOqq35br6CzLf5MPKMD2L8VboA10tKcRfW2n/70
    op_build_user: "OpenPublishBuild"
    op_build_user_email: "vscopbld@microsoft.com"
    access_token:
      secure: GQ3IuQcROfrBh1zCm97nDduFgUcaK9uD4xbawJx5iKcx5IvP7dEahe16nmwF+fQE

  assembly_info:
    patch: true
    file: common\CommonAssemblyInfo.cs
    assembly_version: "{version}"
    assembly_file_version: "{version}"
    assembly_informational_version: "{version}"
           
  install:
    - ps: ./init_script.ps1
    - git submodule update --init --recursive
  
  before_build:
    - ps: nuget restore $env:SOLUTION_NAME
    - ps: ./before_build_docfx.ps1
      
  build_script:
    - ps: msbuild $env:SOLUTION_NAME /verbosity:m
    
  after_build:
    - ps: ./after_build_docfx.ps1
    
  test_script:
    - ps: ./test_script.ps1

  after_test:
    - ps: ./after_test_nuget.ps1
        

  deploy:
    provider: NuGet
    api_key:
      secure: yoZtG3i28wVuNDk1HrGW/t3tsgt3Ru/Yk/y/sOzUHRc2WVZlynVdWSHK/Bp0uShJ
    skip_symbols: false
    artifact: PCLExt.FileStorage.nupkg
    on:
      configuration: Release
      os: Windows_NT
      APPVEYOR_REPO_TAG: true


########################################################
##               DEVELOPMENT                          ##
########################################################
-
  branches:
    only:
      - devel
       
  image:
    - Visual Studio 2017
    - Ubuntu
  configuration: 
  - Debug
  - Release
  platform: AnyCPU
  version: 1.4.1.{build}
  clone_depth: 1
  
  skip_commits:
    files:
      - docs/*
      - LICENSE
      - README.md
      - .travis.yml
      - codecov.yml
      - .gitignore
      
  cache:
    - packages -> **\packages.config, **\*.csproj, build.ps1 #local nuget folder
#    - '%HOMEDRIVE%%HOMEPATH%\.nuget\packages -> **\packages.config, **\*.csproj, build.ps1' #global nuget folder
    - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml, after_test_fx_core.ps1'
    - '%PROGRAMDATA%\chocolatey\bin -> before_build_docfx.ps1, after_test_fx_core.ps1' #chocolatey native
    - '%PROGRAMDATA%\chocolatey\lib -> before_build_docfx.ps1, after_test_fx_core.ps1' #chocolatey portable
    - '$HOME/.local/share/NuGet/v3-cache' #nuget cache ubuntu
    - '$HOME/.local/share/NuGet/Cache' #nuget cache ubuntu
    - '%LocalAppData%\NuGet\Cache' #v>3 nuget cache windows
    - '%LocalAppData%\NuGet\v3-cache' #nuget cache windows
  
  environment:
    COVERALLS_REPO_TOKEN:  
       secure: q5xCVqG+/0ByXEFTGYgf1lCWwrOqq35br6CzLf5MPKMD2L8VboA10tKcRfW2n/70
    
  assembly_info:
    patch: true
    file: common\CommonAssemblyInfo.cs
    assembly_version: "{version}"
    assembly_file_version: "{version}"
    assembly_informational_version: "{version}-devel"
  
  install:
    - ps: ./init_script.ps1
    - git submodule update --init --recursive
  
  before_build:
    - ps: nuget restore $env:SOLUTION_NAME
 
  build_script:
    - ps: msbuild $env:SOLUTION_NAME /verbosity:m

  test_script:
    - ps: ./test_script.ps1
    
  after_test:
    - ps: ./after_test_nuget-devel.ps1
  
  deploy:
    provider: NuGet
    api_key:
      secure: yoZtG3i28wVuNDk1HrGW/t3tsgt3Ru/Yk/y/sOzUHRc2WVZlynVdWSHK/Bp0uShJ
    skip_symbols: false
    artifact: PCLExt.FileStorage-devel.nupkg
    on:
      os: Windows_NT
      configuration: Release


########################################################
##               ANY OTHER BRANCH                     ##
########################################################
-
  image: 
    - Visual Studio 2017
    - Ubuntu
  configuration: 
  - Debug
  - Release
  platform: AnyCPU
  clone_depth: 1
  
  skip_commits:
    files:
      - docs/*
      - LICENSE
      - README.md
      - .travis.yml
      - codecov.yml
      - .gitignore
      
  cache:
    - packages -> **\packages.config, **\*.csproj, build.ps1 #local nuget folder
#    - '%HOMEDRIVE%%HOMEPATH%\.nuget\packages -> **\packages.config, **\*.csproj, build.ps1' #global nuget folder
    - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml, after_test_fx_core.ps1'
    - '%PROGRAMDATA%\chocolatey\bin -> before_build_docfx.ps1, after_test_fx_core.ps1' #chocolatey native
    - '%PROGRAMDATA%\chocolatey\lib -> before_build_docfx.ps1, after_test_fx_core.ps1' #chocolatey portable
    - '$HOME/.local/share/NuGet/v3-cache' #nuget cache ubuntu
    - '$HOME/.local/share/NuGet/Cache' #nuget cache ubuntu
    - '%LocalAppData%\NuGet\Cache' #v>3 nuget cache windows
    - '%LocalAppData%\NuGet\v3-cache' #nuget cache windows

  install:
    - ps: ./init_script.ps1
    - git submodule update --init --recursive
  
  before_build:
    - ps: nuget restore $env:SOLUTION_NAME
  
  build_script:
    - ps: msbuild $env:SOLUTION_NAME /verbosity:m
    
  test_script:
    - ps: ./test_script.ps1