# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- checkout: self 
  submodules: recursive

- task: UseDotNet@2
  displayName: 'Install latest .NET Core 3.0'
  inputs:
    packageType: sdk
    version: 3.0.x
    installationPath: $(Agent.ToolsDirectory)/dotnet

- task: UseDotNet@2
  displayName: 'Install latest .NET Core 3.1'
  inputs:
    packageType: sdk
    version: 3.1.x
    installationPath: $(Agent.ToolsDirectory)/dotnet

- task: NuGetToolInstaller@0

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

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

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  project: 'HarmonyTests'
  buildConfiguration: 'Release'

steps:
- checkout: self 
  submodules: recursive

- task: UseDotNet@2
  displayName: 'Install latest .NET Core 3.0'
  inputs:
    packageType: sdk
    version: 3.0.x
    installationPath: $(Agent.ToolsDirectory)/dotnet

- task: UseDotNet@2
  displayName: 'Install latest .NET Core 3.1'
  inputs:
    packageType: sdk
    version: 3.1.x
    installationPath: $(Agent.ToolsDirectory)/dotnet

- task: DotNetCoreCLI@2
  displayName: 'Restore and build'
  inputs:
    command: 'build' # this automatically runs 'dotnet restore' as well
    projects: '$(project)'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'Test on non-net35 target frameworks'
  continueOnError: true
  inputs:
    command: 'test'
    projects: '$(project)'
    arguments: '--configuration $(buildConfiguration) --logger console;verbosity=detailed'

- task: DotNetCoreCLI@2
  displayName: 'Test on net35 target framework in CLR 4.0 "compatibility mode"'
  inputs:
    command: 'test'
    projects: '$(project)/bin/$(buildConfiguration)/net35/$(project).dll'
    arguments: '--configuration $(buildConfiguration) --framework net35 --logger console;verbosity=detailed'

Convert Azure Pipelines to use dotnet CLI tasks rather than nuget/vsbuild/vstest tasks
Convert Azure Pipelines to use dotnet CLI tasks rather than nuget/vsbuild/vstest tasks
