####################################################################
# VSTS Build Configuration, Version 1.1
#
# (c)2018 superdev GmbH
####################################################################

name: 2.0.$(date:yy)$(DayOfYear).$(rev:rr)
  
queue:
  name: Hosted VS2017
  demands: 
  - msbuild
  - visualstudio
  - vstest

trigger:
- master
- develop
- release/*

variables:
  solution: 'ValueConverters.Forms.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  nuspecFile: 'ValueConverters.Forms.nuspec'

steps:
- task: bleddynrichards.Assembly-Info-Task.Assembly-Info-Task.Assembly-Info-Task@1
  displayName: 'Set Assembly Manifest Data'
  inputs:
    FileNames: |
     ValueConverters.Forms.csproj
     AssemblyInfo.cs
    InsertAttributes: true
    Title: 'ValueConverters.Forms'
    Description: ''
    Company: 'superdev GmbH'
    Copyright: '(c) $(date:yyyy) superdev GmbH'
    VersionNumber: '$(Build.BuildNumber)'
    FileVersionNumber: '$(Build.BuildNumber)'

- task: NuGetToolInstaller@0
  displayName: 'Use NuGet 4.4.1'
  inputs:
    versionSpec: 4.4.1

- task: NuGetCommand@2
  displayName: 'NuGet restore'
  inputs:
    restoreSolution: '$(solution)'


- powershell: |
   Write-Host "##vso[task.setvariable variable=PackageVersion]$(Build.BuildNumber)"
   Write-Host "##vso[task.setvariable variable=PackageVersionPre]$(Build.BuildNumber)$(BuildVersionPostfix)"
  displayName: 'Set PackageVersion'

- task: VSBuild@1
  displayName: 'Build solution'
  inputs:
    solution: '$(solution)'
    msbuildArgs: ''
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'Run UnitTests'
  continueOnError: false
  inputs:
    command: test
    projects: '**/*.Tests.csproj'
    arguments: ''

- task: NuGetCommand@2
  displayName: 'Pack NuGet PreRelease'
  inputs:
    command: custom
    arguments: pack $(nuspecFile) -Version $(PackageVersionPre) -NoPackageAnalysis -outputdirectory $(Build.ArtifactStagingDirectory)\artifacts

- task: NuGetCommand@2
  displayName: 'Pack NuGet Prod'
  inputs:
    command: custom
    arguments: pack $(nuspecFile) -Version $(PackageVersion) -NoPackageAnalysis -outputdirectory $(Build.ArtifactStagingDirectory)\artifacts

- task: CopyFiles@2
  displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
  inputs:
    SourceFolder: '$(system.defaultworkingdirectory)'

    Contents: |
     **\bin\$(buildConfiguration)\**
     **\bin\*.nupkg

    TargetFolder: '$(Build.ArtifactStagingDirectory)'


- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'


Add build config for forms project
Add build config for forms project
