diff --git a/.appveyor.yml b/.appveyor.yml index a8b12550..70d0f080 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,9 +11,8 @@ install: - ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null - ps: Invoke-WebRequest -Uri "https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1" -OutFile "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 5.0.408 -InstallDir $env:DOTNET_INSTALL_DIR' - - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.417 -InstallDir $env:DOTNET_INSTALL_DIR' - - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.404 -InstallDir $env:DOTNET_INSTALL_DIR' - - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 8.0.100 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 8.0.404 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 9.0.100 -InstallDir $env:DOTNET_INSTALL_DIR' - ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path" - ps: dotnet --info diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 4903ba5f..dd76b6d1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "1.3.0", + "version": "2.3.0", "commands": [ "dotnet-cake" ] diff --git a/.github/renovate.json b/.github/renovate.json index 2aa46b6f..6cd0ad3f 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -5,15 +5,24 @@ ":includeNodeModules" ], "packageRules": [ + { + "description": "Ignore Cake runner minor and patch updates", + "matchDepNames": [ + "Cake.Tool", + "Cake.Frosting" + ], + "matchUpdateTypes": ["minor", "patch"], + "enabled": false + }, { "description": "Group Azure DevOps packages together", "matchManagers": [ "nuget" ], - "matchPackagePatterns": [ - "Microsoft.TeamFoundationServer.Client|Microsoft.VisualStudio.Services.InteractiveClient" - ], - "groupName": "Azure DevOps Client" + "groupName": "Azure DevOps Client", + "matchPackageNames": [ + "/Microsoft.TeamFoundationServer.Client|Microsoft.VisualStudio.Services.InteractiveClient/" + ] } ] -} \ No newline at end of file +} diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index 721c1ba4..f5d7620c 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -3,6 +3,7 @@ issue-labels-include: - Feature - Bug - Improvement +- Dependencies - Documentation issue-labels-exclude: - Build diff --git a/README.md b/README.md index 5ed73c25..50a1152a 100644 --- a/README.md +++ b/README.md @@ -17,20 +17,20 @@ This addin for Cake allows you to work with Azure DevOps. |:------------------:|:------------:|:-------------------------------:|:-------------------:|:-------:|:------:| | Build & Unit Tests | AppVeyor | N/A | Windows Server 2019 |[![Build status](https://ci.appveyor.com/api/projects/status/45blf3csh70opuos/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-azuredevops/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/45blf3csh70opuos/branch/master?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-azuredevops/branch/master)| | Build & Unit Tests | Azure DevOps | N/A | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Build%20%26%20Test%20Windows)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Build%20%26%20Test%20Windows)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Build & Unit Tests | Azure DevOps | N/A | macOS 11 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Build%20%26%20Test%20macOS)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Build%20%26%20Test%20macOS)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Build & Unit Tests | Azure DevOps | N/A | macOS 12 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Build%20%26%20Test%20macOS)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Build%20%26%20Test%20macOS)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| | Build & Unit Tests | Azure DevOps | N/A | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Build%20%26%20Test%20Ubuntu)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Build%20%26%20Test%20Ubuntu)](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Frosting on .NET 6.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Frosting on .NET 7.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Scripting on .NET 6.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Scripting on .NET 7.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Frosting on .NET 6.0 | macOS 11 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Frosting on .NET 7.0 | macOS 11 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Scripting on .NET 6.0 | macOS 11 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Scripting on .NET 7.0 | macOS 11 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Frosting on .NET 6.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Frosting on .NET 7.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Scripting on .NET 6.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%206))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| -| Integration Tests | Azure DevOps | Cake Scripting on .NET 7.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%207))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Frosting on .NET 8.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Frosting on .NET 9.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Windows%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Scripting on .NET 8.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Scripting on .NET 9.0 | Windows Server 2022 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Windows%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Frosting on .NET 8.0 | macOS 14 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Frosting on .NET 9.0 | macOS 14 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20macOS%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Scripting on .NET 8.0 | macOS 14 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Scripting on .NET 9.0 | macOS 14 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20macOS%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Frosting on .NET 8.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Frosting on .NET 9.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Frosting%20Ubuntu%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Scripting on .NET 8.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%208))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| +| Integration Tests | Azure DevOps | Cake Scripting on .NET 9.0 | Ubuntu 20.04 |[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=develop&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_apis/build/status/cake-contrib.Cake.AzureDevOps?branchName=master&jobName=Integration%20Tests%20Script%20Runner%20Ubuntu%20(.NET%209))](https://dev.azure.com/cake-contrib/Cake.AzureDevOps/_build/latest?definitionId=24&branchName=master)| ## Demos diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2e53f365..bfa8f676 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,18 +21,14 @@ jobs: inputs: version: '5.x' displayName: 'Install .NET 5' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - task: UseDotNet@2 - inputs: - version: '7.x' - displayName: 'Install .NET 7' - task: UseDotNet@2 inputs: version: '8.x' displayName: 'Install .NET 8' + - task: UseDotNet@2 + inputs: + version: '9.x' + displayName: 'Install .NET 9' - powershell: | $ENV:CAKE_SKIP_GITVERSION=([string]::IsNullOrEmpty($ENV:SYSTEM_PULLREQUEST_PULLREQUESTID) -eq $False).ToString() .\build.ps1 @@ -46,25 +42,21 @@ jobs: - job: Build_macOS displayName: Build & Test macOS pool: - vmImage: 'macOS-11' + vmImage: 'macOS-12' steps: # .NET 5 required for GitVersion - task: UseDotNet@2 inputs: version: '5.x' displayName: 'Install .NET 5' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - task: UseDotNet@2 - inputs: - version: '7.x' - displayName: 'Install .NET 7' - task: UseDotNet@2 inputs: version: '8.x' displayName: 'Install .NET 8' + - task: UseDotNet@2 + inputs: + version: '9.x' + displayName: 'Install .NET 9' - bash: | ./build.sh displayName: 'Cake Build' @@ -83,18 +75,14 @@ jobs: inputs: version: '5.x' displayName: 'Install .NET 5' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - task: UseDotNet@2 - inputs: - version: '7.x' - displayName: 'Install .NET 7' - task: UseDotNet@2 inputs: version: '8.x' displayName: 'Install .NET 8' + - task: UseDotNet@2 + inputs: + version: '9.x' + displayName: 'Install .NET 9' - bash: | ./build.sh --verbosity=diagnostic displayName: 'Cake Build' @@ -102,56 +90,6 @@ jobs: artifact: NuGet Package Ubuntu displayName: 'Publish NuGet package as build artifact' -# Integration Tests Frosting Windows (.NET 6) -- job: Test_Frosting_Windows_Net6 - displayName: Integration Tests Frosting Windows (.NET 6) - dependsOn: Build_Windows - pool: - vmImage: 'windows-2019' - steps: - - download: current - artifact: NuGet Package Windows - displayName: 'Download build artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows - targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet - displayName: 'Copy build artifact for test run' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - powershell: ./build.ps1 --verbosity=diagnostic - workingDirectory: ./tests/frosting/net6.0 - displayName: 'Run integration tests' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - -# Integration Tests Frosting Windows (.NET 7) -- job: Test_Frosting_Windows_Net7 - displayName: Integration Tests Frosting Windows (.NET 7) - dependsOn: Build_Windows - pool: - vmImage: 'windows-2022' - steps: - - download: current - artifact: NuGet Package Windows - displayName: 'Download build artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows - targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet - displayName: 'Copy build artifact for test run' - - task: UseDotNet@2 - inputs: - version: '7.x' - displayName: 'Install .NET 7' - - powershell: ./build.ps1 --verbosity=diagnostic - workingDirectory: ./tests/frosting/net7.0 - displayName: 'Run integration tests' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - # Integration Tests Frosting Windows (.NET 8) - job: Test_Frosting_Windows_Net8 displayName: Integration Tests Frosting Windows (.NET 8) @@ -177,34 +115,9 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Script Runner Windows (.NET 6) -- job: Test_Script_Runner_Windows_Net6 - displayName: Integration Tests Script Runner Windows (.NET 6) - dependsOn: Build_Windows - pool: - vmImage: 'windows-2019' - steps: - - download: current - artifact: NuGet Package Windows - displayName: 'Download build artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows - targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet - displayName: 'Copy build artifact for test run' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - powershell: ./build.ps1 --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net6.0 - displayName: 'Run integration tests' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - -# Integration Tests Script Runner Windows (.NET 7) -- job: Test_Script_Runner_Windows_Net7 - displayName: Integration Tests Script Runner Windows (.NET 7) +# Integration Tests Frosting Windows (.NET 9) +- job: Test_Frosting_Windows_Net9 + displayName: Integration Tests Frosting Windows (.NET 9) dependsOn: Build_Windows pool: vmImage: 'windows-2022' @@ -219,10 +132,10 @@ jobs: displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '7.x' - displayName: 'Install .NET 7' + version: '9.x' + displayName: 'Install .NET 9' - powershell: ./build.ps1 --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net7.0 + workingDirectory: ./tests/frosting/net9.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -252,52 +165,27 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Frosting macOS (.NET 6) -- job: Test_Frosting_macOS_Net6 - displayName: Integration Tests Frosting macOS (.NET 6) - dependsOn: Build_macOS - pool: - vmImage: 'macOS-11' - steps: - - download: current - artifact: NuGet Package macOS - displayName: 'Download build artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package macOS - targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet - displayName: 'Copy build artifact for test run' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/frosting/net6.0 - displayName: 'Run integration tests' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - -# Integration Tests Frosting macOS (.NET 7) -- job: Test_Frosting_macOS_Net7 - displayName: Integration Tests Frosting macOS (.NET 7) - dependsOn: Build_macOS +# Integration Tests Script Runner Windows (.NET 9) +- job: Test_Script_Runner_Windows_Net9 + displayName: Integration Tests Script Runner Windows (.NET 9) + dependsOn: Build_Windows pool: - vmImage: 'macOS-11' + vmImage: 'windows-2022' steps: - download: current - artifact: NuGet Package macOS + artifact: NuGet Package Windows displayName: 'Download build artifact' - task: CopyFiles@2 inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package macOS + sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '7.x' - displayName: 'Install .NET 7' - - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/frosting/net7.0 + version: '9.x' + displayName: 'Install .NET 9' + - powershell: ./build.ps1 --verbosity=diagnostic + workingDirectory: ./tests/script-runner/net9.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -307,7 +195,7 @@ jobs: displayName: Integration Tests Frosting macOS (.NET 8) dependsOn: Build_macOS pool: - vmImage: 'macOS-11' + vmImage: 'macOS-14' steps: - download: current artifact: NuGet Package macOS @@ -327,37 +215,12 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Script Runner macOS (.NET 6) -- job: Test_Script_Runner_macOS_Net6 - displayName: Integration Tests Script Runner macOS (.NET 6) - dependsOn: Build_macOS - pool: - vmImage: 'macOS-11' - steps: - - download: current - artifact: NuGet Package macOS - displayName: 'Download build artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package macOS - targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet - displayName: 'Copy build artifact for test run' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net6.0 - displayName: 'Run integration tests' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - -# Integration Tests Script Runner macOS (.NET 7) -- job: Test_Script_Runner_macOS_Net7 - displayName: Integration Tests Script Runner macOS (.NET 7) +# Integration Tests Frosting macOS (.NET 9) +- job: Test_Frosting_macOS_Net9 + displayName: Integration Tests Frosting macOS (.NET 9) dependsOn: Build_macOS pool: - vmImage: 'macOS-11' + vmImage: 'macOS-14' steps: - download: current artifact: NuGet Package macOS @@ -369,10 +232,10 @@ jobs: displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '7.x' - displayName: 'Install .NET 7' + version: '9.x' + displayName: 'Install .NET 9' - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net7.0 + workingDirectory: ./tests/frosting/net9.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -382,7 +245,7 @@ jobs: displayName: Integration Tests Script Runner macOS (.NET 8) dependsOn: Build_macOS pool: - vmImage: 'macOS-11' + vmImage: 'macOS-14' steps: - download: current artifact: NuGet Package macOS @@ -402,52 +265,27 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Frosting Ubuntu (.NET 6) -- job: Test_Frosting_Ubuntu_Net6 - displayName: Integration Tests Frosting Ubuntu (.NET 6) - dependsOn: Build_Ubuntu - pool: - vmImage: 'ubuntu-20.04' - steps: - - download: current - artifact: NuGet Package Ubuntu - displayName: 'Download build artifact' - - task: CopyFiles@2 - inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package Ubuntu - targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet - displayName: 'Copy build artifact for test run' - - task: UseDotNet@2 - inputs: - version: '6.x' - displayName: 'Install .NET 6' - - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/frosting/net6.0 - displayName: 'Run integration tests' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - -# Integration Tests Frosting Ubuntu (.NET 7) -- job: Test_Frosting_Ubuntu_Net7 - displayName: Integration Tests Frosting Ubuntu (.NET 7) - dependsOn: Build_Ubuntu +# Integration Tests Script Runner macOS (.NET 9) +- job: Test_Script_Runner_macOS_Net9 + displayName: Integration Tests Script Runner macOS (.NET 9) + dependsOn: Build_macOS pool: - vmImage: 'ubuntu-20.04' + vmImage: 'macOS-14' steps: - download: current - artifact: NuGet Package Ubuntu + artifact: NuGet Package macOS displayName: 'Download build artifact' - task: CopyFiles@2 inputs: - sourceFolder: $(Pipeline.Workspace)/NuGet Package Ubuntu + sourceFolder: $(Pipeline.Workspace)/NuGet Package macOS targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '7.x' - displayName: 'Install .NET 7' + version: '9.x' + displayName: 'Install .NET 9' - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/frosting/net7.0 + workingDirectory: ./tests/script-runner/net9.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) @@ -477,9 +315,9 @@ jobs: env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Script Runner Ubuntu (.NET 6) -- job: Test_Script_Runner_Ubuntu_Net6 - displayName: Integration Tests Script Runner Ubuntu (.NET 6) +# Integration Tests Frosting Ubuntu (.NET 9) +- job: Test_Frosting_Ubuntu_Net9 + displayName: Integration Tests Frosting Ubuntu (.NET 9) dependsOn: Build_Ubuntu pool: vmImage: 'ubuntu-20.04' @@ -494,17 +332,17 @@ jobs: displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '6.x' - displayName: 'Install .NET 6' + version: '9.x' + displayName: 'Install .NET 9' - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net6.0 + workingDirectory: ./tests/frosting/net9.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Script Runner Ubuntu (.NET 7) -- job: Test_Script_Runner_Ubuntu_Net7 - displayName: Integration Tests Script Runner Ubuntu (.NET 7) +# Integration Tests Script Runner Ubuntu (.NET 8) +- job: Test_Script_Runner_Ubuntu_Net8 + displayName: Integration Tests Script Runner Ubuntu (.NET 8) dependsOn: Build_Ubuntu pool: vmImage: 'ubuntu-20.04' @@ -519,17 +357,17 @@ jobs: displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '7.x' - displayName: 'Install .NET 7' + version: '8.x' + displayName: 'Install .NET 8' - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net7.0 + workingDirectory: ./tests/script-runner/net8.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) -# Integration Tests Script Runner Ubuntu (.NET 8) -- job: Test_Script_Runner_Ubuntu_Net8 - displayName: Integration Tests Script Runner Ubuntu (.NET 8) +# Integration Tests Script Runner Ubuntu (.NET 9) +- job: Test_Script_Runner_Ubuntu_Net9 + displayName: Integration Tests Script Runner Ubuntu (.NET 9) dependsOn: Build_Ubuntu pool: vmImage: 'ubuntu-20.04' @@ -544,10 +382,10 @@ jobs: displayName: 'Copy build artifact for test run' - task: UseDotNet@2 inputs: - version: '8.x' - displayName: 'Install .NET 8' + version: '9.x' + displayName: 'Install .NET 9' - bash: ./build.sh --verbosity=diagnostic - workingDirectory: ./tests/script-runner/net8.0 + workingDirectory: ./tests/script-runner/net9.0 displayName: 'Run integration tests' env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) diff --git a/global.json b/global.json index 3660ff88..5110c037 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": true, - "version": "8.0.100", + "version": "9.0.100", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/src/Cake.AzureDevOps/3rdPartyLicense.txt b/nuspec/nuget/3rdPartyLicense.txt similarity index 100% rename from src/Cake.AzureDevOps/3rdPartyLicense.txt rename to nuspec/nuget/3rdPartyLicense.txt diff --git a/nuspec/nuget/Cake.AzureDevOps.nuspec b/nuspec/nuget/Cake.AzureDevOps.nuspec new file mode 100644 index 00000000..61f1f97f --- /dev/null +++ b/nuspec/nuget/Cake.AzureDevOps.nuspec @@ -0,0 +1,46 @@ + + + + Cake.AzureDevOps + Cake.AzureDevOps + 0.0.0 + Pascal Berger + pascalberger + Addin for the Cake build automation system for working with Azure DevOps + +Addin for the Cake build automation system for working with Azure DevOps. + +NOTE: +This is the version of the addin compatible with Cake Script Runners. +For addin compatible with Cake Frosting see Cake.Frosting.AzureDevOps. + + MIT + http://cake-contrib.github.io/Cake.AzureDevOps/ + icon.png + false + + Copyright © Pascal Berger + cake cake-addin azure-devops azure-devops-server + https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/5.0.0 + + + + + + + + + + + + + + + + + + + + + + diff --git a/nuspec/nuget/Cake.Frosting.AzureDevOps.nuspec b/nuspec/nuget/Cake.Frosting.AzureDevOps.nuspec new file mode 100644 index 00000000..1ee56b12 --- /dev/null +++ b/nuspec/nuget/Cake.Frosting.AzureDevOps.nuspec @@ -0,0 +1,60 @@ + + + + Cake.Frosting.AzureDevOps + Cake.Frosting.AzureDevOps + 0.0.0 + Pascal Berger + pascalberger + Addin for the Cake build automation system for working with Azure DevOps + +Addin for the Cake build automation system for working with Azure DevOps. + +NOTE: +This is the version of the addin compatible with Cake Frosting. +For addin compatible with Cake Script Runners see Cake.AzureDevOps. + + MIT + http://cake-contrib.github.io/Cake.AzureDevOps/ + icon.png + false + + Copyright © Pascal Berger + cake cake-addin azure-devops azure-devops-server + https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/5.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nuspec/nuget/Cake.Frosting.AzureDevOps.targets b/nuspec/nuget/Cake.Frosting.AzureDevOps.targets new file mode 100644 index 00000000..dd89fd90 --- /dev/null +++ b/nuspec/nuget/Cake.Frosting.AzureDevOps.targets @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Cake.AzureDevOps/icon.png b/nuspec/nuget/icon.png similarity index 100% rename from src/Cake.AzureDevOps/icon.png rename to nuspec/nuget/icon.png diff --git a/recipe.cake b/recipe.cake index 9909382e..27fecc99 100644 --- a/recipe.cake +++ b/recipe.cake @@ -1,4 +1,4 @@ -#load nuget:?package=Cake.Recipe&version=3.1.1 +#load nuget:https://pkgs.dev.azure.com/cake-contrib/Home/_packaging/addins/nuget/v3/index.json?package=Cake.Recipe&version=4.0.0-alpha0126 Environment.SetVariableNames(); @@ -10,8 +10,7 @@ BuildParameters.SetParameters( repositoryOwner: "cake-contrib", repositoryName: "Cake.AzureDevOps", appVeyorAccountName: "cakecontrib", - shouldCalculateVersion: true, - shouldRunDotNetCorePack: true, + shouldUseDeterministicBuilds: true, shouldGenerateDocumentation: false, // Fails to restore tool on AppVeyor shouldRunCoveralls: false, // Fails to restore tool on AppVeyor shouldRunCodecov: false); // Fails to restore tool on AppVeyor @@ -24,7 +23,4 @@ ToolSettings.SetToolSettings( testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*", testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"); -// Disable Upload-Coveralls-Report task since it fails to install the tool on AppVeyor -BuildParameters.Tasks.UploadCoverallsReportTask.WithCriteria(() => false); - Build.RunDotNetCore(); diff --git a/src/Cake.AzureDevOps.Tests/ArgumentChecksTests.cs b/src/Cake.AzureDevOps.Tests/ArgumentChecksTests.cs index 05f055b1..0997a44a 100644 --- a/src/Cake.AzureDevOps.Tests/ArgumentChecksTests.cs +++ b/src/Cake.AzureDevOps.Tests/ArgumentChecksTests.cs @@ -139,4 +139,4 @@ public void Should_Not_Throw_If_Value_Is_Positive(int value) } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Authentication/AuthenticationProviderTests.cs b/src/Cake.AzureDevOps.Tests/Authentication/AuthenticationProviderTests.cs index 7582a0cb..98a50348 100644 --- a/src/Cake.AzureDevOps.Tests/Authentication/AuthenticationProviderTests.cs +++ b/src/Cake.AzureDevOps.Tests/Authentication/AuthenticationProviderTests.cs @@ -417,4 +417,4 @@ public void Should_Set_Password() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsAadCredentialsTests.cs b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsAadCredentialsTests.cs index b10ed14f..f7b72264 100644 --- a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsAadCredentialsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsAadCredentialsTests.cs @@ -38,4 +38,4 @@ public void Should_Set_Password_Name(string password) } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsBasicCredentialsTests.cs b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsBasicCredentialsTests.cs index 82d6fd35..6d8aaae6 100644 --- a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsBasicCredentialsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsBasicCredentialsTests.cs @@ -38,4 +38,4 @@ public void Should_Set_Password_Name(string password) } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsNtlmCredentialsTests.cs b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsNtlmCredentialsTests.cs index 947a763a..f3b620e4 100644 --- a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsNtlmCredentialsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsNtlmCredentialsTests.cs @@ -20,4 +20,4 @@ public void Should_Not_Throw() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsOAuthCredentialsTests.cs b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsOAuthCredentialsTests.cs index dde07e9e..128351f2 100644 --- a/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsOAuthCredentialsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Authentication/AzureDevOpsOAuthCredentialsTests.cs @@ -62,4 +62,4 @@ public void Should_Set_Access_Token() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsImpl.cs b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsImpl.cs index d5ed0b9e..b204c053 100644 --- a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsImpl.cs +++ b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsImpl.cs @@ -20,4 +20,4 @@ public BaseAzureDevOpsCollectionSettingsImpl(IAzureDevOpsCredentials credentials { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsTests.cs b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsTests.cs index 753c0c85..a184f1b6 100644 --- a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCollectionSettingsTests.cs @@ -215,4 +215,4 @@ public void Dispose() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsImpl.cs b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsImpl.cs index b9c84e81..c07f68e0 100644 --- a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsImpl.cs +++ b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsImpl.cs @@ -14,4 +14,4 @@ public BaseAzureDevOpsCredentialsSettingsImpl(BaseAzureDevOpsCredentialsSettings { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsTests.cs b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsTests.cs index 8d38db54..4767f898 100644 --- a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsCredentialsSettingsTests.cs @@ -70,4 +70,4 @@ public void Should_Set_Credentials() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsImpl.cs b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsImpl.cs index 0cddca24..9a908421 100644 --- a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsImpl.cs +++ b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsImpl.cs @@ -25,4 +25,4 @@ public BaseAzureDevOpsProjectSettingsImpl(IAzureDevOpsCredentials credentials) { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsTests.cs b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsTests.cs index 96d5060c..014add6a 100644 --- a/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/BaseAzureDevOpsProjectSettingsTests.cs @@ -475,4 +475,4 @@ public void Dispose() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj index db93ce3b..93438623 100644 --- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj +++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net8.0;net9.0 false Cake.AzureDevOps Copyright © Pascal Berger @@ -14,16 +14,25 @@ - - - - - + + + + + - - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/src/Cake.AzureDevOps.Tests/ExceptionAssertExtensions.cs b/src/Cake.AzureDevOps.Tests/ExceptionAssertExtensions.cs index 7dd44750..a1a82c12 100644 --- a/src/Cake.AzureDevOps.Tests/ExceptionAssertExtensions.cs +++ b/src/Cake.AzureDevOps.Tests/ExceptionAssertExtensions.cs @@ -103,4 +103,4 @@ public static void IsAzureDevOpsBranchNotFoundException(this Exception exception Assert.Equal(message, exception.Message); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetBuildClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetBuildClientFactory.cs index 6d8e6ec8..fc26d25f 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetBuildClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetBuildClientFactory.cs @@ -32,14 +32,14 @@ public override BuildHttpClient CreateBuildClient(Uri collectionUrl, IAzureDevOp }); mock.Setup(arg => arg.GetBuildWorkItemsRefsAsync(It.IsAny(), It.IsAny(), It.IsAny(), null, default)) - .ReturnsAsync((string _, int _, int? _, object _, CancellationToken _) => new List - { - new () { Id = "42" }, - }); + .ReturnsAsync((string _, int _, int? _, object _, CancellationToken _) => + [ + new() { Id = "42" }, + ]); mock = this.Setup(mock); return mock.Object; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs index ed0b98b0..541ee133 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs @@ -105,14 +105,14 @@ protected override Mock Setup(Mock m) // Setup CommitDiffs object var gitChanges = new List { - new () + new() { ChangeId = 1, ChangeType = VersionControlChangeType.Edit, Item = new GitItem("/src/project/myclass.cs", "ID1", GitObjectType.Commit, "6b13ff8", 0), }, null, - new () + new() { ChangeId = 2, ChangeType = VersionControlChangeType.Edit, @@ -152,7 +152,7 @@ protected override Mock Setup(Mock m) // Setup GitPullRequestCommentThread collection var commentThreads = new List { - new () + new() { Id = 11, ThreadContext = new CommentThreadContext() @@ -161,12 +161,12 @@ protected override Mock Setup(Mock m) }, Comments = [ - new () { Content = "Hello", IsDeleted = false, CommentType = CommentType.CodeChange, Id = 1 }, - new () { Content = "Goodbye", IsDeleted = true, CommentType = CommentType.Text, Id = 2 }, + new() { Content = "Hello", IsDeleted = false, CommentType = CommentType.CodeChange, Id = 1 }, + new() { Content = "Goodbye", IsDeleted = true, CommentType = CommentType.Text, Id = 2 }, ], Status = CommentThreadStatus.Active, }, - new () + new() { Id = 22, ThreadContext = null, @@ -203,8 +203,8 @@ protected override Mock Setup(Mock m) .ReturnsAsync((Guid _, int _, bool? _, object _, CancellationToken _) => [ - new () { Id = 42, CreatedDate = DateTime.Today.AddDays(-3) }, - new () { Id = 16, CreatedDate = DateTime.Today.AddDays(-1) }, + new() { Id = 42, CreatedDate = DateTime.Today.AddDays(-3) }, + new() { Id = 16, CreatedDate = DateTime.Today.AddDays(-1) }, ]); m.Setup(arg => arg.GetPullRequestIterationsAsync( @@ -216,7 +216,7 @@ protected override Mock Setup(Mock m) .ReturnsAsync((Guid _, int _, bool? _, object _, CancellationToken _) => [ - new () { Id = null }, + new() { Id = null }, ]); // Setup GitPullRequestIterationChanges collection @@ -224,8 +224,8 @@ protected override Mock Setup(Mock m) { ChangeEntries = [ - new () { ChangeId = 100, ChangeTrackingId = 1, Item = new GitItem { Path = "/src/my/class1.cs" } }, - new () { ChangeId = 200, ChangeTrackingId = 2, Item = new GitItem { Path = string.Empty } }, + new() { ChangeId = 100, ChangeTrackingId = 1, Item = new GitItem { Path = "/src/my/class1.cs" } }, + new() { ChangeId = 200, ChangeTrackingId = 2, Item = new GitItem { Path = string.Empty } }, ], }; @@ -274,7 +274,7 @@ protected override Mock Setup(Mock m) CancellationToken.None)) .ReturnsAsync(() => [ - new ("master"), + new("master"), ]); m.Setup( @@ -306,7 +306,7 @@ protected override Mock Setup(Mock m) gitPullRequestToCreate.LastMergeTargetCommit = new GitCommitRef { CommitId = "78a3c113" }; return gitPullRequestToCreate; - }); + }); m.Setup(arg => arg.UpdateCommentAsync( It.IsAny(), @@ -319,11 +319,11 @@ protected override Mock Setup(Mock m) .ReturnsAsync((Comment comment, Guid _, int _, int _, int _, object _, CancellationToken _) => new Comment { - Id = comment.Id, - Content = comment.Content, + Id = comment.Id, + Content = comment.Content, }); return m; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs index 158e60a0..53e6449a 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs @@ -22,13 +22,13 @@ public override TestManagementHttpClient CreateTestManagementClient(Uri collecti { ResultsForGroup = [ - new () + new() { Results = [ - new () { Id = 11, TestRun = new ShallowReference { Id = "1" } }, - new () { Id = 12, TestRun = new ShallowReference { Id = "1" } }, - new () { Id = 13, TestRun = new ShallowReference { Id = "1" } }, + new() { Id = 11, TestRun = new ShallowReference { Id = "1" } }, + new() { Id = 12, TestRun = new ShallowReference { Id = "1" } }, + new() { Id = 13, TestRun = new ShallowReference { Id = "1" } }, ], }, ], @@ -40,9 +40,9 @@ public override TestManagementHttpClient CreateTestManagementClient(Uri collecti var result = new List { - new () { AutomatedTestName = "t1", Outcome = "Passed", ErrorMessage = string.Empty }, - new () { AutomatedTestName = "t2", Outcome = "Failed", ErrorMessage = "Error" }, - new () { AutomatedTestName = "t3", Outcome = "Passed", ErrorMessage = string.Empty }, + new() { AutomatedTestName = "t1", Outcome = "Passed", ErrorMessage = string.Empty }, + new() { AutomatedTestName = "t2", Outcome = "Failed", ErrorMessage = "Error" }, + new() { AutomatedTestName = "t3", Outcome = "Passed", ErrorMessage = string.Empty }, }; if (top.HasValue) @@ -58,4 +58,4 @@ public override TestManagementHttpClient CreateTestManagementClient(Uri collecti return mock.Object; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeBuildClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeBuildClientFactory.cs index df727dfb..41dc6200 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeBuildClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeBuildClientFactory.cs @@ -21,4 +21,4 @@ protected Mock Setup(Mock m) return m; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeGitClientFactory.cs index 61df4e4f..2dfa41a6 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeGitClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeGitClientFactory.cs @@ -21,4 +21,4 @@ protected virtual Mock Setup(Mock m) return m; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullBuildClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullBuildClientFactory.cs index af5ebffd..b0cafbfa 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullBuildClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullBuildClientFactory.cs @@ -22,4 +22,4 @@ public override BuildHttpClient CreateBuildClient(Uri collectionUrl, IAzureDevOp return mock.Object; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs index a2d96888..46ad155f 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs @@ -1,7 +1,6 @@ namespace Cake.AzureDevOps.Tests.Fakes { using System; - using System.Collections.Generic; using System.Threading; using Microsoft.TeamFoundation.SourceControl.WebApi; using Moq; @@ -40,4 +39,4 @@ protected override Mock Setup(Mock m) return m; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs index 4ce93f88..f5b309c8 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs @@ -1,7 +1,6 @@ namespace Cake.AzureDevOps.Tests.Fakes { using System; - using System.Collections.Generic; using Cake.AzureDevOps.Authentication; using Microsoft.TeamFoundation.SourceControl.WebApi; using Moq; @@ -23,4 +22,4 @@ public override GitHttpClient CreateGitClient(Uri collectionUrl, IAzureDevOpsCre return mock.Object; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeTestManagementClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeTestManagementClientFactory.cs index 0d1596d4..1c2924bc 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeTestManagementClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeTestManagementClientFactory.cs @@ -21,4 +21,4 @@ protected Mock Setup(Mock m) return m; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeWorkItemTrackingClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeWorkItemTrackingClientFactory.cs index bc1448c8..de657037 100644 --- a/src/Cake.AzureDevOps.Tests/Fakes/FakeWorkItemTrackingClientFactory.cs +++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeWorkItemTrackingClientFactory.cs @@ -21,4 +21,4 @@ protected Mock Setup(Mock build.GetTestRuns(null, new[] { "FakeOutcome" })); + var result = Record.Exception(() => build.GetTestRuns(null, ["FakeOutcome"])); // Then result.IsArgumentException(null); @@ -163,4 +163,4 @@ public void Should_Return_List_Of_WorkItems() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Pipelines/AzureDevOpsBuildsSettingsTests.cs b/src/Cake.AzureDevOps.Tests/Pipelines/AzureDevOpsBuildsSettingsTests.cs index 0eb56725..717f7e1c 100644 --- a/src/Cake.AzureDevOps.Tests/Pipelines/AzureDevOpsBuildsSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Pipelines/AzureDevOpsBuildsSettingsTests.cs @@ -682,4 +682,4 @@ public void Dispose() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Pipelines/BuildFixture.cs b/src/Cake.AzureDevOps.Tests/Pipelines/BuildFixture.cs index 4e62c6e1..ba0c3bb2 100644 --- a/src/Cake.AzureDevOps.Tests/Pipelines/BuildFixture.cs +++ b/src/Cake.AzureDevOps.Tests/Pipelines/BuildFixture.cs @@ -35,4 +35,4 @@ private void InitializeFakes() this.WorkItemTrackingClientFactory = new FakeAllSetWorkItemTrackingClientFactory(); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsCreatePullRequestSettingsTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsCreatePullRequestSettingsTests.cs index 7305290e..9a5f3973 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsCreatePullRequestSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsCreatePullRequestSettingsTests.cs @@ -309,4 +309,4 @@ public void Should_Set_Credentials() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs index 33dc7637..34cd8162 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs @@ -1071,4 +1071,4 @@ public void Dispose() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestTests.cs index ce998bdb..e6271a7f 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestTests.cs @@ -1296,4 +1296,4 @@ public void Should_Return_Collection_Of_Valid_Iteration_Changes() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/BasePullRequestFixture.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/BasePullRequestFixture.cs index b7f2be8a..8043dde4 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/BasePullRequestFixture.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/BasePullRequestFixture.cs @@ -24,4 +24,4 @@ private void InitializeFakes() this.GitClientFactory = new FakeAllSetGitClientFactory(); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsCommentTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsCommentTests.cs index 34c537d0..95bae464 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsCommentTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsCommentTests.cs @@ -92,4 +92,4 @@ public void Should_Return_Valid_Comment_Via_Initializers() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs index d7f0e3f3..1da3f1ca 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs @@ -32,7 +32,7 @@ public void Should_Return_Empty_Comment_Thread() // Then thread.ShouldNotBeNull(); - thread.InnerThread.ShouldBeOfType(typeof(GitPullRequestCommentThread)); + thread.InnerThread.ShouldBeOfType(); thread.Id.ShouldBe(default); thread.FilePath.ShouldBeNull(); thread.Status.ShouldBe(default); @@ -52,7 +52,7 @@ public void Should_Return_Valid_Comment_Thread() ThreadContext = new CommentThreadContext { FilePath = "/src/myclass.cs" }, Comments = [ - new () { Content = "Hello", CommentType = CommentType.Text, IsDeleted = false } + new() { Content = "Hello", CommentType = CommentType.Text, IsDeleted = false } ], Properties = [], }; @@ -157,7 +157,7 @@ public void Should_Set_Properly() { Comments = [ - new ("hi", false) + new("hi", false) ], }; @@ -424,4 +424,4 @@ public void Should_Set_Valid_Properties() } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs index 1e32c2d1..214e927b 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs @@ -16,4 +16,4 @@ internal class CreatePullRequestFixture(string repoUrl, string sourceRefName, st description, new AzureDevOpsNtlmCredentials()); } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestFixture.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestFixture.cs index 9b244224..6cf89cf3 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestFixture.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestFixture.cs @@ -19,4 +19,4 @@ public PullRequestFixture(string repoUrl, string sourceRefName) public AzureDevOpsPullRequestSettings Settings { get; init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestStatusExtensionsTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestStatusExtensionsTests.cs index e2103bcf..ad9788a5 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestStatusExtensionsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/PullRequestStatusExtensionsTests.cs @@ -41,4 +41,4 @@ public void Should_Throw_If_Invalid_Value_Is_Passed(PullRequestStatus state) } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/ArgumentChecks.cs b/src/Cake.AzureDevOps/ArgumentChecks.cs index 8ee96a5a..07f0d840 100644 --- a/src/Cake.AzureDevOps/ArgumentChecks.cs +++ b/src/Cake.AzureDevOps/ArgumentChecks.cs @@ -17,7 +17,7 @@ internal static class ArgumentChecks /// The name of the parameter to include in any thrown exception. /// Thrown if is null. [DebuggerStepThrough] - public static void NotNull([ValidatedNotNull]this T value, string parameterName) + public static void NotNull([ValidatedNotNull] this T value, string parameterName) where T : class { if (value == null) @@ -34,7 +34,7 @@ public static void NotNull([ValidatedNotNull]this T value, string parameterNa /// Thrown if is null. /// Thrown if is empty or consists only of white-space characters. [DebuggerStepThrough] - public static void NotNullOrWhiteSpace([ValidatedNotNull]this string value, string parameterName) + public static void NotNullOrWhiteSpace([ValidatedNotNull] this string value, string parameterName) { if (value == null) { @@ -98,4 +98,4 @@ public static void NotNegative(this int value, string parameterName) } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/AuthenticationProvider.cs b/src/Cake.AzureDevOps/Authentication/AuthenticationProvider.cs index 07195c05..2cb95de4 100644 --- a/src/Cake.AzureDevOps/Authentication/AuthenticationProvider.cs +++ b/src/Cake.AzureDevOps/Authentication/AuthenticationProvider.cs @@ -78,4 +78,4 @@ public static IAzureDevOpsCredentials AuthenticationAzureActiveDirectory( return new AzureDevOpsAadCredentials(userName, password); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs index f11cced2..0a6cb726 100644 --- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs +++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs @@ -8,4 +8,4 @@ public class AzureDevOpsAadCredentials(string userName, string password) : AzureDevOpsBasicCredentials(userName, password) { } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs index ab351fc7..493cd5a8 100644 --- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs +++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs @@ -17,4 +17,4 @@ public class AzureDevOpsBasicCredentials(string userName, string password) : IAz /// public string Password { get; } = password; } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsCredentialsExtensions.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsCredentialsExtensions.cs index da3a251c..8ed31180 100644 --- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsCredentialsExtensions.cs +++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsCredentialsExtensions.cs @@ -40,4 +40,4 @@ public static VssCredentials ToVssCredentials(this IAzureDevOpsCredentials crede } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsNtlmCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsNtlmCredentials.cs index adbfbe50..393a5fc0 100644 --- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsNtlmCredentials.cs +++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsNtlmCredentials.cs @@ -6,4 +6,4 @@ public class AzureDevOpsNtlmCredentials : IAzureDevOpsCredentials { } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsOAuthCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsOAuthCredentials.cs index fe766fc3..b0c65f71 100644 --- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsOAuthCredentials.cs +++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsOAuthCredentials.cs @@ -21,4 +21,4 @@ public AzureDevOpsOAuthCredentials(string accessToken) /// public string AccessToken { get; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Authentication/IAzureDevOpsCredentials.cs b/src/Cake.AzureDevOps/Authentication/IAzureDevOpsCredentials.cs index a4b7d1d4..be1c81cc 100644 --- a/src/Cake.AzureDevOps/Authentication/IAzureDevOpsCredentials.cs +++ b/src/Cake.AzureDevOps/Authentication/IAzureDevOpsCredentials.cs @@ -6,4 +6,4 @@ public interface IAzureDevOpsCredentials { } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.Authentication.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.Authentication.cs index 0d7e7b08..be0887bf 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsAliases.Authentication.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.Authentication.cs @@ -113,4 +113,4 @@ public static IAzureDevOpsCredentials AzureDevOpsAuthenticationAzureActiveDirect return AuthenticationProvider.AuthenticationAzureActiveDirectory(userName, password); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs index 01744f53..c8976388 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.Pipelines.cs @@ -50,12 +50,7 @@ public static AzureDevOpsBuild AzureDevOpsBuild( var build = new AzureDevOpsBuild(context.Log, settings, new BuildClientFactory(), new TestManagementClientFactory(), new WorkItemTrackingClientFactory()); - if (build.HasBuildLoaded) - { - return build; - } - - return null; + return build.HasBuildLoaded ? build : null; } /// @@ -609,4 +604,4 @@ public static IEnumerable AzureDevOpsBuildDefinition settings); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs index a6a1e986..65c644d3 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs @@ -52,12 +52,7 @@ public static AzureDevOpsPullRequest AzureDevOpsPullRequest( var pullRequest = new AzureDevOpsPullRequest(context.Log, settings, new GitClientFactory()); - if (pullRequest.HasPullRequestLoaded) - { - return pullRequest; - } - - return null; + return pullRequest.HasPullRequestLoaded ? pullRequest : null; } /// diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.WorkItemTracking.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.WorkItemTracking.cs index f78528dd..d68ce8dd 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsAliases.WorkItemTracking.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.WorkItemTracking.cs @@ -48,12 +48,7 @@ public static AzureDevOpsWorkItem AzureDevOpsWorkItem( var workItem = new AzureDevOpsWorkItem(context.Log, settings, new WorkItemTrackingClientFactory()); - if (workItem.HasWorkItemLoaded) - { - return workItem; - } - - return null; + return workItem.HasWorkItemLoaded ? workItem : null; } /// diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.cs index b5f5e22e..46dfa830 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsAliases.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.cs @@ -9,4 +9,4 @@ public static partial class AzureDevOpsAliases { } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/AzureDevOpsException.cs b/src/Cake.AzureDevOps/AzureDevOpsException.cs index d4c0ba77..bb8f77d1 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsException.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsException.cs @@ -1,7 +1,6 @@ namespace Cake.AzureDevOps { using System; - using System.Runtime.Serialization; /// /// Represents errors that occur during connecting to Azure DevOps. @@ -37,4 +36,4 @@ public AzureDevOpsException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/BaseAzureDevOpsCollectionSettings.cs b/src/Cake.AzureDevOps/BaseAzureDevOpsCollectionSettings.cs index 09b28831..bd4995a2 100644 --- a/src/Cake.AzureDevOps/BaseAzureDevOpsCollectionSettings.cs +++ b/src/Cake.AzureDevOps/BaseAzureDevOpsCollectionSettings.cs @@ -49,4 +49,4 @@ protected BaseAzureDevOpsCollectionSettings(IAzureDevOpsCredentials credentials) /// public Uri CollectionUrl { get; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/BaseAzureDevOpsCredentialsSettings.cs b/src/Cake.AzureDevOps/BaseAzureDevOpsCredentialsSettings.cs index a0dc1e1c..9974c4c3 100644 --- a/src/Cake.AzureDevOps/BaseAzureDevOpsCredentialsSettings.cs +++ b/src/Cake.AzureDevOps/BaseAzureDevOpsCredentialsSettings.cs @@ -35,4 +35,4 @@ protected BaseAzureDevOpsCredentialsSettings(BaseAzureDevOpsCredentialsSettings /// public IAzureDevOpsCredentials Credentials { get; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/BaseAzureDevOpsProjectSettings.cs b/src/Cake.AzureDevOps/BaseAzureDevOpsProjectSettings.cs index 8baf27e1..ed44bdd9 100644 --- a/src/Cake.AzureDevOps/BaseAzureDevOpsProjectSettings.cs +++ b/src/Cake.AzureDevOps/BaseAzureDevOpsProjectSettings.cs @@ -18,10 +18,7 @@ public abstract class BaseAzureDevOpsProjectSettings : BaseAzureDevOpsCollection protected BaseAzureDevOpsProjectSettings(Uri collectionUrl, Guid projectGuid, IAzureDevOpsCredentials credentials) : base(collectionUrl, credentials) { - if (projectGuid == Guid.Empty) - { - throw new ArgumentOutOfRangeException(nameof(projectGuid)); - } + ArgumentOutOfRangeException.ThrowIfEqual(projectGuid, Guid.Empty); this.ProjectGuid = projectGuid; } @@ -76,4 +73,4 @@ protected BaseAzureDevOpsProjectSettings(IAzureDevOpsCredentials credentials) /// public string ProjectName { get; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItem.cs b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItem.cs index 10d2dfff..af0fc6fa 100644 --- a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItem.cs +++ b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItem.cs @@ -148,18 +148,7 @@ internal AzureDevOpsWorkItem( /// /// If work item could not be found and /// is set to true. - public int WorkItemId - { - get - { - if (!this.ValidateWorkItem()) - { - return 0; - } - - return this.workItem.Id ?? 0; - } - } + public int WorkItemId => this.ValidateWorkItem() ? this.workItem.Id ?? 0 : 0; /// /// Gets the title of the work item. @@ -168,18 +157,7 @@ public int WorkItemId /// /// If work item could not be found and /// is set to true. - public string Title - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.Title"); - } - } + public string Title => this.ValidateWorkItem() ? this.GetField("System.Title") : string.Empty; /// /// Gets the description of the work item. @@ -188,18 +166,7 @@ public string Title /// /// If work item could not be found and /// is set to true. - public string Description - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.Description"); - } - } + public string Description => this.ValidateWorkItem() ? this.GetField("System.Description") : string.Empty; /// /// Gets the area path of the work item. @@ -208,18 +175,7 @@ public string Description /// /// If work item could not be found and /// is set to true. - public string AreaPath - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.AreaPath"); - } - } + public string AreaPath => this.ValidateWorkItem() ? this.GetField("System.AreaPath") : string.Empty; /// /// Gets the team project name of the work item. @@ -228,18 +184,7 @@ public string AreaPath /// /// If work item could not be found and /// is set to true. - public string TeamProject - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.TeamProject"); - } - } + public string TeamProject => this.ValidateWorkItem() ? this.GetField("System.TeamProject") : string.Empty; /// /// Gets the iteration path of the work item. @@ -248,18 +193,7 @@ public string TeamProject /// /// If work item could not be found and /// is set to true. - public string IterationPath - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.IterationPath"); - } - } + public string IterationPath => this.ValidateWorkItem() ? this.GetField("System.IterationPath") : string.Empty; /// /// Gets the type of the work item. @@ -268,18 +202,7 @@ public string IterationPath /// /// If work item could not be found and /// is set to true. - public string WorkItemType - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.WorkItemType"); - } - } + public string WorkItemType => this.ValidateWorkItem() ? this.GetField("System.WorkItemType") : string.Empty; /// /// Gets the state of the work item. @@ -288,18 +211,7 @@ public string WorkItemType /// /// If work item could not be found and /// is set to true. - public string State - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.State"); - } - } + public string State => this.ValidateWorkItem() ? this.GetField("System.State") : string.Empty; /// /// Gets the reason of the state of the work item. @@ -308,18 +220,7 @@ public string State /// /// If work item could not be found and /// is set to true. - public string Reason - { - get - { - if (!this.ValidateWorkItem()) - { - return string.Empty; - } - - return this.GetField("System.Reason"); - } - } + public string Reason => this.ValidateWorkItem() ? this.GetField("System.Reason") : string.Empty; /// /// Gets the create date of the work item. @@ -328,18 +229,7 @@ public string Reason /// /// If work item could not be found and /// is set to true. - public DateTime CreateDate - { - get - { - if (!this.ValidateWorkItem()) - { - return DateTime.MinValue; - } - - return this.GetFieldAsDate("System.CreatedDate"); - } - } + public DateTime CreateDate => this.ValidateWorkItem() ? this.GetFieldAsDate("System.CreatedDate") : DateTime.MinValue; /// /// Gets the modify date of the work item. @@ -348,18 +238,7 @@ public DateTime CreateDate /// /// If work item could not be found and /// is set to true. - public DateTime ChangeDate - { - get - { - if (!this.ValidateWorkItem()) - { - return DateTime.MinValue; - } - - return this.GetFieldAsDate("System.ChangedDate"); - } - } + public DateTime ChangeDate => this.ValidateWorkItem() ? this.GetFieldAsDate("System.ChangedDate") : DateTime.MinValue; /// /// Gets the tags of the work item. @@ -368,18 +247,9 @@ public DateTime ChangeDate /// /// If work item could not be found and /// is set to true. - public IEnumerable Tags - { - get - { - if (!this.ValidateWorkItem()) - { - return Array.Empty(); - } - - return this.GetField("System.Tags").Split("; ", StringSplitOptions.RemoveEmptyEntries); - } - } + public IEnumerable Tags => this.ValidateWorkItem() + ? (IEnumerable)this.GetField("System.Tags").Split("; ", StringSplitOptions.RemoveEmptyEntries) + : []; /// /// Gets the id of the parent work item. @@ -388,18 +258,7 @@ public IEnumerable Tags /// /// If work item could not be found and /// is set to true. - public int ParentWorkItemId - { - get - { - if (!this.ValidateWorkItem()) - { - return 0; - } - - return this.GetFieldAsInt("System.Parent"); - } - } + public int ParentWorkItemId => this.ValidateWorkItem() ? this.GetFieldAsInt("System.Parent") : 0; /// /// Gets the parent work item or null of no parent exists. @@ -445,38 +304,17 @@ private bool ValidateWorkItem() private string GetField(string fieldName) { - if (this.workItem.Fields.TryGetValue(fieldName, out var field)) - { - return field.ToString(); - } - else - { - return string.Empty; - } + return this.workItem.Fields.TryGetValue(fieldName, out var field) ? field.ToString() : string.Empty; } private DateTime GetFieldAsDate(string fieldName) { - if (this.workItem.Fields.TryGetValue(fieldName, out var field)) - { - return (DateTime)field; - } - else - { - return DateTime.MinValue; - } + return this.workItem.Fields.TryGetValue(fieldName, out var field) ? (DateTime)field : DateTime.MinValue; } private int GetFieldAsInt(string fieldName) { - if (this.workItem.Fields.TryGetValue(fieldName, out var field)) - { - return Convert.ToInt32(field); - } - else - { - return 0; - } + return this.workItem.Fields.TryGetValue(fieldName, out var field) ? Convert.ToInt32(field) : 0; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs index bfd5d8fe..e4976153 100644 --- a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs +++ b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs @@ -36,4 +36,4 @@ public AzureDevOpsWorkItemException(string message, Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs index 870fade6..def2289e 100644 --- a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs +++ b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs @@ -45,4 +45,4 @@ public AzureDevOpsWorkItemNotFoundException(string message, Exception innerExcep { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemSettings.cs b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemSettings.cs index 5b016199..c05d51e1 100644 --- a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemSettings.cs +++ b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemSettings.cs @@ -115,4 +115,4 @@ public static AzureDevOpsWorkItemSettings UsingAzurePipelinesOAuthToken(int work return new AzureDevOpsWorkItemSettings(workItemId, new AzureDevOpsOAuthCredentials(accessToken)); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/BuildClientFactory.cs b/src/Cake.AzureDevOps/BuildClientFactory.cs index 99ec7b9f..c1d18dcb 100644 --- a/src/Cake.AzureDevOps/BuildClientFactory.cs +++ b/src/Cake.AzureDevOps/BuildClientFactory.cs @@ -27,4 +27,4 @@ public BuildHttpClient CreateBuildClient(Uri collectionUrl, IAzureDevOpsCredenti throw new AzureDevOpsException("Could not retrieve the BuildHttpClient object"); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj index ca6a0202..6e53302c 100644 --- a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj +++ b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net8.0;net9.0 @@ -16,13 +16,6 @@ Addin for the Cake build automation system for working with Azure DevOps. Pascal Berger Copyright © Pascal Berger - cake cake-addin azure-devops azure-devops-server - icon.png - http://cake-contrib.github.io/Cake.AzureDevOps/ - MIT - git - https://github.com/cake-contrib/Cake.AzureDevOps.git - https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/$(Version) true false $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs @@ -30,80 +23,26 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + + + + + + + + - - - - - - - - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - lib\$(TargetFramework)\ - - - diff --git a/src/Cake.AzureDevOps/EnvironmentVariableHelper.cs b/src/Cake.AzureDevOps/EnvironmentVariableHelper.cs index 40ded4cd..cdaa9fab 100644 --- a/src/Cake.AzureDevOps/EnvironmentVariableHelper.cs +++ b/src/Cake.AzureDevOps/EnvironmentVariableHelper.cs @@ -15,13 +15,10 @@ internal static class EnvironmentVariableHelper public static string GetSystemAccessToken() { var accessToken = Environment.GetEnvironmentVariable("SYSTEM_ACCESSTOKEN", EnvironmentVariableTarget.Process); - if (string.IsNullOrWhiteSpace(accessToken)) - { - throw new InvalidOperationException( + return !string.IsNullOrWhiteSpace(accessToken) + ? accessToken + : throw new InvalidOperationException( "Failed to read the SYSTEM_ACCESSTOKEN environment variable. Make sure you are running in an Azure Pipelines build and that the 'Allow Scripts to access OAuth token' option is enabled."); - } - - return accessToken; } /// @@ -32,13 +29,10 @@ public static string GetSystemAccessToken() public static Uri GetSystemTeamFoundationCollectionUri() { var collectionUrl = Environment.GetEnvironmentVariable("SYSTEM_TEAMFOUNDATIONCOLLECTIONURI", EnvironmentVariableTarget.Process); - if (string.IsNullOrWhiteSpace(collectionUrl)) - { - throw new InvalidOperationException( - "Failed to read the SYSTEM_TEAMFOUNDATIONCOLLECTIONURI environment variable. Make sure you are running in an Azure Pipelines build."); - } - - return new Uri(collectionUrl); + return string.IsNullOrWhiteSpace(collectionUrl) + ? throw new InvalidOperationException( + "Failed to read the SYSTEM_TEAMFOUNDATIONCOLLECTIONURI environment variable. Make sure you are running in an Azure Pipelines build.") + : new Uri(collectionUrl); } /// @@ -49,13 +43,10 @@ public static Uri GetSystemTeamFoundationCollectionUri() public static string GetSystemTeamProject() { var projectName = Environment.GetEnvironmentVariable("SYSTEM_TEAMPROJECT", EnvironmentVariableTarget.Process); - if (string.IsNullOrWhiteSpace(projectName)) - { - throw new InvalidOperationException( - "Failed to read the SYSTEM_TEAMPROJECT environment variable. Make sure you are running in an Azure Pipelines build."); - } - - return projectName; + return string.IsNullOrWhiteSpace(projectName) + ? throw new InvalidOperationException( + "Failed to read the SYSTEM_TEAMPROJECT environment variable. Make sure you are running in an Azure Pipelines build.") + : projectName; } /// @@ -77,12 +68,9 @@ public static int GetBuildId() throw new InvalidOperationException("BUILD_BUILDID environment variable should contain integer value"); } - if (buildIdValue <= 0) - { - throw new InvalidOperationException("BUILD_BUILDID environment variable should contain integer value and it should be greater than zero"); - } - - return buildIdValue; + return buildIdValue <= 0 + ? throw new InvalidOperationException("BUILD_BUILDID environment variable should contain integer value and it should be greater than zero") + : buildIdValue; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/GitClientFactory.cs b/src/Cake.AzureDevOps/GitClientFactory.cs index 81b2388d..70124962 100644 --- a/src/Cake.AzureDevOps/GitClientFactory.cs +++ b/src/Cake.AzureDevOps/GitClientFactory.cs @@ -27,4 +27,4 @@ public GitHttpClient CreateGitClient(Uri collectionUrl, IAzureDevOpsCredentials throw new AzureDevOpsException("Could not retrieve the GitHttpClient object"); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/IBuildClientFactory.cs b/src/Cake.AzureDevOps/IBuildClientFactory.cs index ad5895c7..8b37b24e 100644 --- a/src/Cake.AzureDevOps/IBuildClientFactory.cs +++ b/src/Cake.AzureDevOps/IBuildClientFactory.cs @@ -27,4 +27,4 @@ internal interface IBuildClientFactory /// The instance of class. BuildHttpClient CreateBuildClient(Uri collectionUrl, IAzureDevOpsCredentials credentials, out Identity authorizedIdentity); } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/IGitClientFactory.cs b/src/Cake.AzureDevOps/IGitClientFactory.cs index fc99b8d0..c67e9dca 100644 --- a/src/Cake.AzureDevOps/IGitClientFactory.cs +++ b/src/Cake.AzureDevOps/IGitClientFactory.cs @@ -27,4 +27,4 @@ internal interface IGitClientFactory /// The instance of class. GitHttpClient CreateGitClient(Uri collectionUrl, IAzureDevOpsCredentials credentials, out Identity authorizedIdentity); } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/ITestManagementClientFactory.cs b/src/Cake.AzureDevOps/ITestManagementClientFactory.cs index 39ac6ed8..7b276345 100644 --- a/src/Cake.AzureDevOps/ITestManagementClientFactory.cs +++ b/src/Cake.AzureDevOps/ITestManagementClientFactory.cs @@ -28,4 +28,4 @@ internal interface ITestManagementClientFactory // ReSharper disable once UnusedMemberInSuper.Global TestManagementHttpClient CreateTestManagementClient(Uri collectionUrl, IAzureDevOpsCredentials credentials, out Identity authorizedIdentity); } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/IWorkItemTrackingClientFactory.cs b/src/Cake.AzureDevOps/IWorkItemTrackingClientFactory.cs index 41531c29..0906215b 100644 --- a/src/Cake.AzureDevOps/IWorkItemTrackingClientFactory.cs +++ b/src/Cake.AzureDevOps/IWorkItemTrackingClientFactory.cs @@ -27,4 +27,4 @@ internal interface IWorkItemTrackingClientFactory /// The instance of class. WorkItemTrackingHttpClient CreateWorkItemTrackingClient(Uri collectionUrl, IAzureDevOpsCredentials credentials, out Identity authorizedIdentity); } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/ArtifactResourceExtensions.cs b/src/Cake.AzureDevOps/Pipelines/ArtifactResourceExtensions.cs index f353bd6f..dd2ada3b 100644 --- a/src/Cake.AzureDevOps/Pipelines/ArtifactResourceExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/ArtifactResourceExtensions.cs @@ -18,20 +18,16 @@ public static AzureDevOpsArtifactResource ToAzureDevOpsArtifactResource(this Art { artifactResource.NotNull(nameof(artifactResource)); - if (!Enum.TryParse(artifactResource.Type, true, out AzurePipelinesArtifactType type)) - { - throw new InvalidOperationException($"Unexpected value for artifact type '{artifactResource.Type}'"); - } - - return - new AzureDevOpsArtifactResource + return Enum.TryParse(artifactResource.Type, true, out AzurePipelinesArtifactType type) + ? new AzureDevOpsArtifactResource { Data = artifactResource.Data, DownloadUrl = artifactResource.DownloadUrl, Type = type, Url = artifactResource.Url, Properties = artifactResource.Properties, - }; + } + : throw new InvalidOperationException($"Unexpected value for artifact type '{artifactResource.Type}'"); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs index 516e650e..88f0b0fe 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs @@ -34,4 +34,4 @@ public class AzureDevOpsArtifactResource /// public Dictionary Properties { get; init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs index 6775d400..bf6335f5 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs @@ -162,18 +162,7 @@ internal AzureDevOpsBuild( /// /// If build could not be found and /// is set to true. - public Guid ProjectId - { - get - { - if (!this.ValidateBuild()) - { - return Guid.Empty; - } - - return this.build.Project.Id; - } - } + public Guid ProjectId => this.ValidateBuild() ? this.build.Project.Id : Guid.Empty; /// /// Gets the name of the Azure DevOps project. @@ -182,18 +171,7 @@ public Guid ProjectId /// /// If build could not be found and /// is set to true. - public string ProjectName - { - get - { - if (!this.ValidateBuild()) - { - return string.Empty; - } - - return this.build.Project.Name; - } - } + public string ProjectName => this.ValidateBuild() ? this.build.Project.Name : string.Empty; /// /// Gets the name of the Git repository. @@ -202,18 +180,7 @@ public string ProjectName /// /// If build could not be found and /// is set to true. - public string RepositoryName - { - get - { - if (!this.ValidateBuild()) - { - return string.Empty; - } - - return this.build.Repository.Name; - } - } + public string RepositoryName => this.ValidateBuild() ? this.build.Repository.Name : string.Empty; /// /// Gets the ID of the repository. @@ -222,18 +189,7 @@ public string RepositoryName /// /// If build could not be found and /// is set to true. - public Guid RepositoryId - { - get - { - if (!this.ValidateBuild()) - { - return Guid.Empty; - } - - return new Guid(this.build.Repository.Id); - } - } + public Guid RepositoryId => this.ValidateBuild() ? new Guid(this.build.Repository.Id) : Guid.Empty; /// /// Gets the ID of the build. @@ -242,18 +198,7 @@ public Guid RepositoryId /// /// If build could not be found and /// is set to true. - public int BuildId - { - get - { - if (!this.ValidateBuild()) - { - return 0; - } - - return this.build.Id; - } - } + public int BuildId => this.ValidateBuild() ? this.build.Id : 0; /// /// Gets the status of the build. @@ -262,18 +207,10 @@ public int BuildId /// /// If build could not be found and /// is set to true. - public AzureDevOpsBuildStatus? Status - { - get - { - if (!this.ValidateBuild()) - { - return 0; - } - - return this.build.Status?.ToAzureDevOpsBuildStatus(); - } - } + public AzureDevOpsBuildStatus? Status => + this.ValidateBuild() + ? this.build.Status?.ToAzureDevOpsBuildStatus() + : (AzureDevOpsBuildStatus?)0; /// /// Gets the result of the build. @@ -286,18 +223,10 @@ public AzureDevOpsBuildStatus? Status /// /// If build could not be found and /// is set to true. - public AzureDevOpsBuildResult? Result - { - get - { - if (!this.ValidateBuild()) - { - return 0; - } - - return this.build.Result?.ToAzureDevOpsBuildResult(); - } - } + public AzureDevOpsBuildResult? Result => + this.ValidateBuild() + ? this.build.Result?.ToAzureDevOpsBuildResult() + : (AzureDevOpsBuildResult?)0; /// /// Gets the finish time of the build. @@ -306,18 +235,7 @@ public AzureDevOpsBuildResult? Result /// /// If build could not be found and /// is set to true. - public DateTime? FinishTime - { - get - { - if (!this.ValidateBuild()) - { - return null; - } - - return this.build.FinishTime; - } - } + public DateTime? FinishTime => this.ValidateBuild() ? this.build.FinishTime : null; /// /// Gets the parameters passed to the build. @@ -687,7 +605,7 @@ private async Task> GetTestResults( runId, skip: resultCount, top: resultsToRead, - outcomes: filterOutcomesList?.Select(o => (TestOutcome)Enum.Parse(typeof(TestOutcome), o, true)).ToList()) + outcomes: filterOutcomesList?.Select(o => Enum.Parse(o, true)).ToList()) .ConfigureAwait(false)) .Select(test => new AzureDevOpsTestResult @@ -729,4 +647,4 @@ private bool ValidateBuild() return false; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildArtifact.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildArtifact.cs index 248224e6..bfa0805f 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildArtifact.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildArtifact.cs @@ -21,4 +21,4 @@ public class AzureDevOpsBuildArtifact /// public AzureDevOpsArtifactResource Resource { get; internal set; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildDefinition.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildDefinition.cs index ec36b87e..f1aff278 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildDefinition.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildDefinition.cs @@ -21,4 +21,4 @@ public class AzureDevOpsBuildDefinition /// public AzureDevOpsDefinitionQueueStatus QueueStatus { get; internal init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs index a821fe99..36e5cbc6 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs @@ -36,4 +36,4 @@ public AzureDevOpsBuildNotFoundException(string message, Exception innerExceptio { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrder.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrder.cs index aba01da1..da7369ae 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrder.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrder.cs @@ -35,4 +35,4 @@ public enum AzureDevOpsBuildQueryOrder : byte /// StartTimeAscending = 7, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrderExtensions.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrderExtensions.cs index a7fb7b6c..101069c3 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrderExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildQueryOrderExtensions.cs @@ -27,4 +27,4 @@ public static BuildQueryOrder ToBuildQueryOrder(this AzureDevOpsBuildQueryOrder }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResult.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResult.cs index a3acaa3c..003bbbe8 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResult.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResult.cs @@ -30,4 +30,4 @@ public enum AzureDevOpsBuildResult : byte /// Canceled = 32, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResultExtensions.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResultExtensions.cs index 6d812a2c..1ffdbec4 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResultExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildResultExtensions.cs @@ -26,4 +26,4 @@ public static BuildResult ToBuildResult(this AzureDevOpsBuildResult result) }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildSettings.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildSettings.cs index b4be154a..137f570d 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildSettings.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildSettings.cs @@ -111,4 +111,4 @@ public static AzureDevOpsBuildSettings UsingAzurePipelinesOAuthToken(int buildId return new AzureDevOpsBuildSettings(buildId, new AzureDevOpsOAuthCredentials(accessToken)); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatus.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatus.cs index 88c5a8d9..1e82719f 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatus.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatus.cs @@ -40,4 +40,4 @@ public enum AzureDevOpsBuildStatus : byte /// All = 47, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatusExtensions.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatusExtensions.cs index f6671ed5..b5a4d31d 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatusExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildStatusExtensions.cs @@ -28,4 +28,4 @@ public static BuildStatus ToBuildStatus(this AzureDevOpsBuildStatus status) }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsDefinitionHelper.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsDefinitionHelper.cs index 3dfe2d25..44656b5e 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsDefinitionHelper.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsDefinitionHelper.cs @@ -62,4 +62,4 @@ internal static IEnumerable GetAzureDevOpsBuildDefin } } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsHelper.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsHelper.cs index d96a8c19..85935b31 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsHelper.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsHelper.cs @@ -139,4 +139,4 @@ private static AzureDevOpsBuildDefinition GetBuildDefinition( return buildDefinition; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsSettings.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsSettings.cs index 7743b611..415c9e8b 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsSettings.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildsSettings.cs @@ -100,4 +100,4 @@ public static AzureDevOpsBuildsSettings UsingAzurePipelinesOAuthToken() return new AzureDevOpsBuildsSettings(new AzureDevOpsOAuthCredentials(accessToken)); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsChange.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsChange.cs index 04d417c0..29c65145 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsChange.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsChange.cs @@ -56,4 +56,4 @@ public class AzureDevOpsChange /// public string Pusher { get; internal set; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsDefinitionQueueStatus.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsDefinitionQueueStatus.cs index 52033401..45a452cb 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsDefinitionQueueStatus.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsDefinitionQueueStatus.cs @@ -26,4 +26,4 @@ public enum AzureDevOpsDefinitionQueueStatus : byte /// Disabled = 2, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTaskResult.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTaskResult.cs index f16c397b..bf0ef79a 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTaskResult.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTaskResult.cs @@ -35,4 +35,4 @@ public enum AzureDevOpsTaskResult : byte /// Abandoned = 5, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestResult.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestResult.cs index d6cf460a..2ac45aaa 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestResult.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestResult.cs @@ -21,4 +21,4 @@ public class AzureDevOpsTestResult /// public string ErrorMessage { get; internal set; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestRun.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestRun.cs index 8fc14f1f..b99db996 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestRun.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTestRun.cs @@ -17,4 +17,4 @@ public class AzureDevOpsTestRun /// public IEnumerable TestResults { get; internal init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecord.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecord.cs index 348e7e16..b1ef3cf1 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecord.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecord.cs @@ -101,4 +101,4 @@ public class AzureDevOpsTimelineRecord /// public Guid Id { get; internal init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecordState.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecordState.cs index 896555f6..f036cdbe 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecordState.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsTimelineRecordState.cs @@ -20,4 +20,4 @@ public enum AzureDevOpsTimelineRecordState : byte /// Completed = 2, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/BuildArtifactExtensions.cs b/src/Cake.AzureDevOps/Pipelines/BuildArtifactExtensions.cs index f501df95..833e47cd 100644 --- a/src/Cake.AzureDevOps/Pipelines/BuildArtifactExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/BuildArtifactExtensions.cs @@ -25,4 +25,4 @@ public static AzureDevOpsBuildArtifact ToAzureDevOpsBuildArtifact(this BuildArti }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/BuildDefinitionReferenceExtensions.cs b/src/Cake.AzureDevOps/Pipelines/BuildDefinitionReferenceExtensions.cs index 60712581..42dccce4 100644 --- a/src/Cake.AzureDevOps/Pipelines/BuildDefinitionReferenceExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/BuildDefinitionReferenceExtensions.cs @@ -25,4 +25,4 @@ public static AzureDevOpsBuildDefinition ToAzureDevOpsBuildDefinition(this Build }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/BuildResultExtensions.cs b/src/Cake.AzureDevOps/Pipelines/BuildResultExtensions.cs index 464ffc98..1ed96b78 100644 --- a/src/Cake.AzureDevOps/Pipelines/BuildResultExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/BuildResultExtensions.cs @@ -26,4 +26,4 @@ public static AzureDevOpsBuildResult ToAzureDevOpsBuildResult(this BuildResult r }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/BuildStatusExtensions.cs b/src/Cake.AzureDevOps/Pipelines/BuildStatusExtensions.cs index 13584481..8a59736a 100644 --- a/src/Cake.AzureDevOps/Pipelines/BuildStatusExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/BuildStatusExtensions.cs @@ -28,4 +28,4 @@ public static AzureDevOpsBuildStatus ToAzureDevOpsBuildStatus(this BuildStatus s }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/ChangeExtensions.cs b/src/Cake.AzureDevOps/Pipelines/ChangeExtensions.cs index 473ec341..807ea452 100644 --- a/src/Cake.AzureDevOps/Pipelines/ChangeExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/ChangeExtensions.cs @@ -31,4 +31,4 @@ public static AzureDevOpsChange ToAzureDevOpsChange(this Change change) }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/DefinitionQueueStatusExtensions.cs b/src/Cake.AzureDevOps/Pipelines/DefinitionQueueStatusExtensions.cs index d6b72945..c2456571 100644 --- a/src/Cake.AzureDevOps/Pipelines/DefinitionQueueStatusExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/DefinitionQueueStatusExtensions.cs @@ -24,4 +24,4 @@ public static AzureDevOpsDefinitionQueueStatus ToAzureDevOpsDefinitionQueueStatu }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/TaskResultExtensions.cs b/src/Cake.AzureDevOps/Pipelines/TaskResultExtensions.cs index 61b616a5..38d65efe 100644 --- a/src/Cake.AzureDevOps/Pipelines/TaskResultExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/TaskResultExtensions.cs @@ -27,4 +27,4 @@ public static AzureDevOpsTaskResult ToAzureDevOpsTaskResult(this TaskResult resu }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/TimelineRecordExtensions.cs b/src/Cake.AzureDevOps/Pipelines/TimelineRecordExtensions.cs index 58897acb..91ef747f 100644 --- a/src/Cake.AzureDevOps/Pipelines/TimelineRecordExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/TimelineRecordExtensions.cs @@ -40,4 +40,4 @@ public static AzureDevOpsTimelineRecord ToAzureDevOpsTimelineRecord(this Timelin }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Pipelines/TimelineRecordStateExtensions.cs b/src/Cake.AzureDevOps/Pipelines/TimelineRecordStateExtensions.cs index 6082864a..0fc542c7 100644 --- a/src/Cake.AzureDevOps/Pipelines/TimelineRecordStateExtensions.cs +++ b/src/Cake.AzureDevOps/Pipelines/TimelineRecordStateExtensions.cs @@ -24,4 +24,4 @@ public static AzureDevOpsTimelineRecordState ToAzureDevOpsTimelineRecordState(th }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/AzureDevOpsCommit.cs b/src/Cake.AzureDevOps/Repos/AzureDevOpsCommit.cs index c3da39d6..f21d6145 100644 --- a/src/Cake.AzureDevOps/Repos/AzureDevOpsCommit.cs +++ b/src/Cake.AzureDevOps/Repos/AzureDevOpsCommit.cs @@ -41,4 +41,4 @@ internal AzureDevOpsCommit() /// public string RemoteUrl { get; internal init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/GitCommitRefExtensions.cs b/src/Cake.AzureDevOps/Repos/GitCommitRefExtensions.cs index 1c96cf67..bb599e03 100644 --- a/src/Cake.AzureDevOps/Repos/GitCommitRefExtensions.cs +++ b/src/Cake.AzureDevOps/Repos/GitCommitRefExtensions.cs @@ -27,4 +27,4 @@ public static AzureDevOpsCommit ToAzureDevOpsCommit(this GitCommitRef commit) }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs index 1820366d..bc282d4c 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs @@ -36,4 +36,4 @@ public AzureDevOpsBranchNotFoundException(string branchName, Exception innerExce { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsCreatePullRequestSettings.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsCreatePullRequestSettings.cs index d50d9aaf..e985038f 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsCreatePullRequestSettings.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsCreatePullRequestSettings.cs @@ -76,20 +76,17 @@ public static AzureDevOpsCreatePullRequestSettings UsingAzurePipelinesOAuthToken { var accessToken = Environment.GetEnvironmentVariable("SYSTEM_ACCESSTOKEN", EnvironmentVariableTarget.Process); - if (string.IsNullOrWhiteSpace(accessToken)) - { - throw new InvalidOperationException( - "Failed to read the SYSTEM_ACCESSTOKEN environment variable. Make sure you are running in an Azure Pipelines build and that the 'Allow Scripts to access OAuth token' option is enabled."); - } - return - new AzureDevOpsCreatePullRequestSettings( + !string.IsNullOrWhiteSpace(accessToken) + ? new AzureDevOpsCreatePullRequestSettings( repositoryUrl, sourceRefName, targetRefName, title, description, - new AzureDevOpsOAuthCredentials(accessToken)); + new AzureDevOpsOAuthCredentials(accessToken)) + : throw new InvalidOperationException( + "Failed to read the SYSTEM_ACCESSTOKEN environment variable. Make sure you are running in an Azure Pipelines build and that the 'Allow Scripts to access OAuth token' option is enabled."); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs index a287930d..f03847fb 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs @@ -171,18 +171,7 @@ internal AzureDevOpsPullRequest(ICakeLog log, AzureDevOpsPullRequestSettings set /// /// If pull request could not be found and /// is set to true. - public Guid RepositoryId - { - get - { - if (!this.ValidatePullRequest()) - { - return Guid.Empty; - } - - return this.pullRequest.Repository.Id; - } - } + public Guid RepositoryId => this.ValidatePullRequest() ? this.pullRequest.Repository.Id : Guid.Empty; /// /// Gets the ID of the pull request. @@ -191,18 +180,7 @@ public Guid RepositoryId /// /// If pull request could not be found and /// is set to true. - public int PullRequestId - { - get - { - if (!this.ValidatePullRequest()) - { - return 0; - } - - return this.pullRequest.PullRequestId; - } - } + public int PullRequestId => this.ValidatePullRequest() ? this.pullRequest.PullRequestId : 0; /// /// Gets if the pull request is in draft mode. @@ -211,18 +189,7 @@ public int PullRequestId /// /// If pull request could not be found and /// is set to true. - public bool? IsDraft - { - get - { - if (!this.ValidatePullRequest()) - { - return null; - } - - return this.pullRequest.IsDraft; - } - } + public bool? IsDraft => this.ValidatePullRequest() ? this.pullRequest.IsDraft : null; /// /// Gets the status of the pull request. @@ -231,18 +198,10 @@ public bool? IsDraft /// /// If pull request could not be found and /// is set to true. - public AzureDevOpsPullRequestState PullRequestStatus - { - get - { - if (!this.ValidatePullRequest()) - { - return AzureDevOpsPullRequestState.NotSet; - } - - return this.pullRequest.Status.ToAzureDevOpsPullRequestState(); - } - } + public AzureDevOpsPullRequestState PullRequestStatus => + this.ValidatePullRequest() + ? this.pullRequest.Status.ToAzureDevOpsPullRequestState() + : AzureDevOpsPullRequestState.NotSet; /// /// Gets the ID of the code review. @@ -251,18 +210,7 @@ public AzureDevOpsPullRequestState PullRequestStatus /// /// If pull request could not be found and /// is set to true. - public int CodeReviewId - { - get - { - if (!this.ValidatePullRequest()) - { - return 0; - } - - return this.pullRequest.CodeReviewId; - } - } + public int CodeReviewId => this.ValidatePullRequest() ? this.pullRequest.CodeReviewId : 0; /// /// Gets the name of the source branch from the pull request. @@ -271,18 +219,7 @@ public int CodeReviewId /// is set to false.. /// If pull request could not be found and /// is set to true. - public string SourceRefName - { - get - { - if (!this.ValidatePullRequest()) - { - return string.Empty; - } - - return this.pullRequest.SourceRefName; - } - } + public string SourceRefName => this.ValidatePullRequest() ? this.pullRequest.SourceRefName : string.Empty; /// /// Gets the name of the target branch. @@ -291,18 +228,7 @@ public string SourceRefName /// /// If pull request could not be found and /// is set to true. - public string TargetRefName - { - get - { - if (!this.ValidatePullRequest()) - { - return string.Empty; - } - - return this.pullRequest.TargetRefName; - } - } + public string TargetRefName => this.ValidatePullRequest() ? this.pullRequest.TargetRefName : string.Empty; /// /// Gets the commit at the head of the source branch at the time of the last pull request merge. @@ -311,18 +237,10 @@ public string TargetRefName /// /// If pull request could not be found and /// is set to true. - public string LastSourceCommitId - { - get - { - if (!this.ValidatePullRequest()) - { - return string.Empty; - } - - return this.pullRequest.LastMergeSourceCommit.CommitId; - } - } + public string LastSourceCommitId => + this.ValidatePullRequest() + ? this.pullRequest.LastMergeSourceCommit.CommitId + : string.Empty; /// /// Gets the commit at the head of the target branch at the time of the last pull request merge. @@ -331,18 +249,10 @@ public string LastSourceCommitId /// /// If pull request could not be found and /// is set to true. - public string LastTargetCommitId - { - get - { - if (!this.ValidatePullRequest()) - { - return string.Empty; - } - - return this.pullRequest.LastMergeTargetCommit.CommitId; - } - } + public string LastTargetCommitId => + this.ValidatePullRequest() + ? this.pullRequest.LastMergeTargetCommit.CommitId + : string.Empty; /// /// Create a pull request. @@ -602,7 +512,7 @@ public AzureDevOpsPullRequestCommentThread CreateComment(string comment) Status = AzureDevOpsCommentThreadStatus.Active, Comments = [ - new () + new() { CommentType = AzureDevOpsCommentType.System, IsDeleted = false, @@ -637,7 +547,7 @@ public AzureDevOpsPullRequestCommentThread CreateComment(string comment, FilePat Status = AzureDevOpsCommentThreadStatus.Active, Comments = [ - new () + new() { CommentType = AzureDevOpsCommentType.System, IsDeleted = false, @@ -953,4 +863,4 @@ private bool ValidatePullRequest() return false; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestIterationChange.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestIterationChange.cs index a62151cb..09310949 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestIterationChange.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestIterationChange.cs @@ -22,4 +22,4 @@ public class AzureDevOpsPullRequestIterationChange /// public int ChangeTrackingId { get; init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs index 312571f3..07ebe09d 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs @@ -46,4 +46,4 @@ public AzureDevOpsPullRequestNotFoundException(string message, Exception innerEx { } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs index f4805b3c..8ad4af06 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs @@ -145,21 +145,18 @@ public static AzureDevOpsPullRequestSettings UsingAzurePipelinesOAuthToken(bool /// Value indicating whether an exception /// should be thrown if required environment variables could not be found. /// Tuple containing a flag if variables are valid and the variable values. - private static (bool valid, string accessToken) RetrieveAzurePipelinesVariables(bool throwExceptionIfVariablesDontExist) + private static (bool Valid, string AccessToken) RetrieveAzurePipelinesVariables(bool throwExceptionIfVariablesDontExist) { var accessToken = Environment.GetEnvironmentVariable("SYSTEM_ACCESSTOKEN", EnvironmentVariableTarget.Process); if (string.IsNullOrWhiteSpace(accessToken)) { - if (!throwExceptionIfVariablesDontExist) - { - return (false, null); - } - - throw new InvalidOperationException( - "Failed to read the SYSTEM_ACCESSTOKEN environment variable. Make sure you are running in an Azure Pipelines build and that the 'Allow Scripts to access OAuth token' option is enabled."); + return throwExceptionIfVariablesDontExist + ? throw new InvalidOperationException( + "Failed to read the SYSTEM_ACCESSTOKEN environment variable. Make sure you are running in an Azure Pipelines build and that the 'Allow Scripts to access OAuth token' option is enabled.") + : ((bool Valid, string AccessToken))(false, null); } return (true, accessToken); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestState.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestState.cs index 909cd2e8..5d5cade2 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestState.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestState.cs @@ -25,4 +25,4 @@ public enum AzureDevOpsPullRequestState : byte /// Completed, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatus.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatus.cs index 21d0efc7..07139b97 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatus.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatus.cs @@ -44,4 +44,4 @@ public AzureDevOpsPullRequestStatus(string name) /// public Uri TargetUrl { get; init; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusState.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusState.cs index 7b013a97..b6d85be3 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusState.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusState.cs @@ -30,4 +30,4 @@ public enum AzureDevOpsPullRequestStatusState : byte /// Error, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusStateExtensions.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusStateExtensions.cs index 8e220893..0a7c59e5 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusStateExtensions.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestStatusStateExtensions.cs @@ -26,4 +26,4 @@ public static GitStatusState ToGitStatusState(this AzureDevOpsPullRequestStatusS }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs b/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs index 4996662d..f927b624 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs @@ -86,4 +86,4 @@ protected BaseAzureDevOpsPullRequestSettings(IAzureDevOpsCredentials credentials /// public string SourceRefName { get; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsComment.cs b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsComment.cs index 04d748de..5ff5992c 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsComment.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsComment.cs @@ -84,4 +84,4 @@ public AzureDevOpsCommentType CommentType /// internal Comment Comment { get; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentThreadStatus.cs b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentThreadStatus.cs index 516d3919..9c126b99 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentThreadStatus.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentThreadStatus.cs @@ -42,4 +42,4 @@ public enum AzureDevOpsCommentThreadStatus /// WontFix = CommentThreadStatus.WontFix, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentType.cs b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentType.cs index e2c88b8c..17dd10c3 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentType.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsCommentType.cs @@ -27,4 +27,4 @@ public enum AzureDevOpsCommentType /// System = CommentType.System, } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThread.cs b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThread.cs index 92f0a849..76d6fcd0 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThread.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThread.cs @@ -80,15 +80,9 @@ public FilePath FilePath /// public int? LineNumber { - get - { - if (this.InnerThread.ThreadContext?.RightFileStart != null) - { - return this.InnerThread.ThreadContext?.RightFileStart.Line; - } - - return null; - } + get => this.InnerThread.ThreadContext?.RightFileStart != null + ? this.InnerThread.ThreadContext?.RightFileStart.Line + : null; init { @@ -107,15 +101,9 @@ public int? LineNumber /// public int? Offset { - get - { - if (this.InnerThread.ThreadContext?.RightFileStart != null) - { - return this.InnerThread.ThreadContext?.RightFileStart.Offset; - } - - return null; - } + get => this.InnerThread.ThreadContext?.RightFileStart != null + ? this.InnerThread.ThreadContext?.RightFileStart.Offset + : null; init { @@ -133,26 +121,20 @@ public int? Offset /// public IEnumerable Comments { - get - { - if (this.InnerThread.Comments == null) - { - throw new InvalidOperationException("Comments list is not created."); - } - - return this.InnerThread.Comments.Select(x => new AzureDevOpsComment(x, this.InnerThread.Id)); - } + get => this.InnerThread.Comments == null + ? throw new InvalidOperationException("Comments list is not created.") + : this.InnerThread.Comments.Select(x => new AzureDevOpsComment(x, this.InnerThread.Id)); init => this.InnerThread.Comments = value? .Select(c => new Comment - { - Content = c.Content, - IsDeleted = c.IsDeleted, - CommentType = (CommentType)c.CommentType, - }).ToList(); + { + Content = c.Content, + IsDeleted = c.IsDeleted, + CommentType = (CommentType)c.CommentType, + }).ToList(); } /// @@ -179,12 +161,7 @@ public T GetValue(string propertyName) { propertyName.NotNullOrWhiteSpace(nameof(propertyName)); - if (this.InnerThread.Properties == null) - { - return default; - } - - return this.InnerThread.Properties.GetValue(propertyName, default(T)); + return this.InnerThread.Properties == null ? default : this.InnerThread.Properties.GetValue(propertyName, default(T)); } /// @@ -219,4 +196,4 @@ private void EnsureRightFileStartExists() this.InnerThread.ThreadContext.RightFileStart ??= new CommentPosition(); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/PullRequestStatusExtensions.cs b/src/Cake.AzureDevOps/Repos/PullRequest/PullRequestStatusExtensions.cs index 7612d0a6..ca148ee3 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/PullRequestStatusExtensions.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/PullRequestStatusExtensions.cs @@ -25,4 +25,4 @@ public static AzureDevOpsPullRequestState ToAzureDevOpsPullRequestState(this Pul }; } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/TestManagementClientFactory.cs b/src/Cake.AzureDevOps/TestManagementClientFactory.cs index 684ccb7c..41b50174 100644 --- a/src/Cake.AzureDevOps/TestManagementClientFactory.cs +++ b/src/Cake.AzureDevOps/TestManagementClientFactory.cs @@ -27,4 +27,4 @@ public TestManagementHttpClient CreateTestManagementClient(Uri collectionUrl, IA throw new AzureDevOpsException("Could not retrieve the TestManagementHttpClient object"); } } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/ValidatedNotNullAttribute.cs b/src/Cake.AzureDevOps/ValidatedNotNullAttribute.cs index a1bc9ddd..a0435b82 100644 --- a/src/Cake.AzureDevOps/ValidatedNotNullAttribute.cs +++ b/src/Cake.AzureDevOps/ValidatedNotNullAttribute.cs @@ -9,4 +9,4 @@ internal sealed class ValidatedNotNullAttribute : Attribute { } -} +} \ No newline at end of file diff --git a/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs b/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs index 97cb5bdb..b6bb76f8 100644 --- a/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs +++ b/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs @@ -27,4 +27,4 @@ public WorkItemTrackingHttpClient CreateWorkItemTrackingClient(Uri collectionUrl throw new AzureDevOpsException("Could not retrieve the WorkItemTrackingHttpClient object"); } } -} +} \ No newline at end of file diff --git a/tests/frosting/net7.0/build.ps1 b/tests/frosting/net7.0/build.ps1 deleted file mode 100644 index c56e9b94..00000000 --- a/tests/frosting/net7.0/build.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -$ADDIN_PACKAGE_PATH = "packages/cake.azuredevops" -if (Test-Path $ADDIN_PACKAGE_PATH) -{ - Write-Host "Cleaning up cached version of $ADDIN_PACKAGE_PATH..." - Remove-Item $ADDIN_PACKAGE_PATH -Recurse; -} -else -{ - Write-Host "$ADDIN_PACKAGE_PATH not cached..." -} - -dotnet run --project build/Build.csproj -- $args -exit $LASTEXITCODE; \ No newline at end of file diff --git a/tests/frosting/net7.0/build.sh b/tests/frosting/net7.0/build.sh deleted file mode 100755 index 8d8f53fa..00000000 --- a/tests/frosting/net7.0/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -$ADDIN_PACKAGE_PATH = "packages/cake.azuredevops" -if [ -d "$ADDIN_PACKAGE_PATH" ] -then - echo "Cleaning up cached version of $ADDIN_PACKAGE_PATH..." - rm -Rf $ADDIN_PACKAGE_PATH -else - echo "$ADDIN_PACKAGE_PATH not cached..." -fi - -dotnet run --project ./build/Build.csproj -- "$@" \ No newline at end of file diff --git a/tests/frosting/net7.0/build/Build.csproj b/tests/frosting/net7.0/build/Build.csproj deleted file mode 100644 index 939e0eb3..00000000 --- a/tests/frosting/net7.0/build/Build.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - Exe - net7.0 - $(MSBuildProjectDirectory) - - - - - - \ No newline at end of file diff --git a/tests/frosting/net7.0/build/Program.cs b/tests/frosting/net7.0/build/Program.cs deleted file mode 100644 index 61cd2527..00000000 --- a/tests/frosting/net7.0/build/Program.cs +++ /dev/null @@ -1,157 +0,0 @@ -using Cake.Common.Build; -using Cake.Common.Diagnostics; -using Cake.Core; -using Cake.Core.Diagnostics; -using Cake.Frosting; -using Cake.AzureDevOps; -using System.Linq; - -public static class Program -{ - public static int Main(string[] args) - { - return new CakeHost() - .UseContext() - .Run(args); - } -} - -public class BuildContext : FrostingContext -{ - public BuildContext(ICakeContext context) - : base(context) - { - } -} - -[TaskName("Read-Build")] -public sealed class ReadBuildTask : FrostingTask -{ - public override void Run(BuildContext context) - { - var build = - context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - context.Information(build.BuildId); - } -} - -[TaskName("Read-BuildChanges")] -public sealed class ReadBuildChangesTask : FrostingTask -{ - public override void Run(BuildContext context) - { - var build = - context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - var changes = build.GetChanges(); - if (!changes.Any()) - { - context.Information("No changes found."); - } - else - { - foreach (var change in changes) - { - context.Information("{0}: {1} by {2}", change.Id, change.Message, change.Author); - } - } - } -} - -[TaskName("Read-BuildTimelineRecords")] -public sealed class ReadBuildTimelineRecordsTask : FrostingTask -{ - public override void Run(BuildContext context) - { - var build = - context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - var timelineRecords = build.GetTimelineRecords(); - if (!timelineRecords.Any()) - { - context.Information("No timeline records found."); - } - else - { - foreach (var timelineRecord in timelineRecords) - { - context.Information("{0}: {1}", timelineRecord.Id, timelineRecord.Name); - } - } - } -} - -[TaskName("Read-BuildArtifacts")] -public sealed class ReadBuildArtifactsTask : FrostingTask -{ - public override void Run(BuildContext context) - { - // var build = - // context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - // var artifacts = build.GetArtifacts(); - // if (!artifacts.Any()) - // { - // context.Information("No artifacts found."); - // } - // else - // { - // foreach (var artifact in artifacts) - // { - // context.Information("{0}: {1}", artifact.Id, artifact.Name); - // } - // } - } -} - -[TaskName("Read-BuildTestRuns")] -public sealed class ReadBuildTestRunsTask : FrostingTask -{ - public override void Run(BuildContext context) - { - // var build = - // context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - // var testRuns = build.GetTestRuns(); - // if (!testRuns.Any()) - // { - // context.Information("No test runs found."); - // } - // else - // { - // foreach (var testRun in testRuns) - // { - // context.Information("{0}", testRun.RunId); - // } - // } - } -} - -[TaskName("Read-PullRequest")] -public sealed class ReadPullRequestTask : FrostingTask -{ - public override bool ShouldRun(BuildContext context) - { - return context.BuildSystem().IsPullRequest; - } - - public override void Run(BuildContext context) - { - // var pullRequest = - // context.AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken(); - - // context.Information(pullRequest.TargetRefName); - } -} - -[TaskName("Default")] -[IsDependentOn(typeof(ReadBuildTask))] -[IsDependentOn(typeof(ReadBuildChangesTask))] -[IsDependentOn(typeof(ReadBuildTimelineRecordsTask))] -[IsDependentOn(typeof(ReadBuildArtifactsTask))] -[IsDependentOn(typeof(ReadBuildTestRunsTask))] -[IsDependentOn(typeof(ReadPullRequestTask))] -public class DefaultTask : FrostingTask -{ -} diff --git a/tests/frosting/net7.0/nuget.config b/tests/frosting/net7.0/nuget.config deleted file mode 100644 index 663b555f..00000000 --- a/tests/frosting/net7.0/nuget.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/frosting/net8.0/build/Build.csproj b/tests/frosting/net8.0/build/Build.csproj index da4a6688..cc479b78 100644 --- a/tests/frosting/net8.0/build/Build.csproj +++ b/tests/frosting/net8.0/build/Build.csproj @@ -5,7 +5,7 @@ $(MSBuildProjectDirectory) - + \ No newline at end of file diff --git a/tests/frosting/net8.0/global.json b/tests/frosting/net8.0/global.json index 3660ff88..db28d4c7 100644 --- a/tests/frosting/net8.0/global.json +++ b/tests/frosting/net8.0/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": true, - "version": "8.0.100", + "version": "8.0.404", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/tests/frosting/net6.0/build.ps1 b/tests/frosting/net9.0/build.ps1 similarity index 100% rename from tests/frosting/net6.0/build.ps1 rename to tests/frosting/net9.0/build.ps1 diff --git a/tests/frosting/net6.0/build.sh b/tests/frosting/net9.0/build.sh similarity index 100% rename from tests/frosting/net6.0/build.sh rename to tests/frosting/net9.0/build.sh diff --git a/tests/frosting/net6.0/build/Build.csproj b/tests/frosting/net9.0/build/Build.csproj similarity index 72% rename from tests/frosting/net6.0/build/Build.csproj rename to tests/frosting/net9.0/build/Build.csproj index 63149696..0764ffee 100644 --- a/tests/frosting/net6.0/build/Build.csproj +++ b/tests/frosting/net9.0/build/Build.csproj @@ -1,11 +1,11 @@ Exe - net6.0 + net9.0 $(MSBuildProjectDirectory) - + \ No newline at end of file diff --git a/tests/frosting/net6.0/build/Program.cs b/tests/frosting/net9.0/build/Program.cs similarity index 100% rename from tests/frosting/net6.0/build/Program.cs rename to tests/frosting/net9.0/build/Program.cs diff --git a/tests/frosting/net7.0/global.json b/tests/frosting/net9.0/global.json similarity index 75% rename from tests/frosting/net7.0/global.json rename to tests/frosting/net9.0/global.json index e9812526..5110c037 100644 --- a/tests/frosting/net7.0/global.json +++ b/tests/frosting/net9.0/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": true, - "version": "7.0.100", + "version": "9.0.100", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/tests/frosting/net6.0/nuget.config b/tests/frosting/net9.0/nuget.config similarity index 100% rename from tests/frosting/net6.0/nuget.config rename to tests/frosting/net9.0/nuget.config diff --git a/tests/script-runner/net6.0/.config/dotnet-tools.json b/tests/script-runner/net6.0/.config/dotnet-tools.json deleted file mode 100644 index 7b346950..00000000 --- a/tests/script-runner/net6.0/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "cake.tool": { - "version": "4.0.0", - "commands": [ - "dotnet-cake" - ] - } - } - } \ No newline at end of file diff --git a/tests/script-runner/net6.0/global.json b/tests/script-runner/net6.0/global.json deleted file mode 100644 index c31f98b7..00000000 --- a/tests/script-runner/net6.0/global.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sdk": { - "allowPrerelease": true, - "version": "6.0.100", - "rollForward": "latestFeature" - } -} \ No newline at end of file diff --git a/tests/script-runner/net7.0/build.cake b/tests/script-runner/net7.0/build.cake deleted file mode 100644 index 20015a30..00000000 --- a/tests/script-runner/net7.0/build.cake +++ /dev/null @@ -1,120 +0,0 @@ -#addin nuget:?package=Cake.AzureDevOps&prerelease - -////////////////////////////////////////////////// -// ARGUMENTS -////////////////////////////////////////////////// - -var target = Argument("target", "Default"); - -////////////////////////////////////////////////// -// TARGETS -////////////////////////////////////////////////// - -Task("Read-Build") - .Does(() => -{ - var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - Information(build.BuildId); -}); - -Task("Read-BuildChanges") - .Does(() => -{ - var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - var changes = build.GetChanges(); - if (!changes.Any()) - { - Information("No changes found."); - } - else - { - foreach (var change in changes) - { - Information("{0}: {1} by {2}", change.Id, change.Message, change.Author); - } - } -}); - -Task("Read-BuildTimelineRecords") - .Does(() => -{ - var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - var timelineRecords = build.GetTimelineRecords(); - if (!timelineRecords.Any()) - { - Information("No timeline records found."); - } - else - { - foreach (var timelineRecord in timelineRecords) - { - Information("{0}: {1}", timelineRecord.Id, timelineRecord.Name); - } - } -}); - -Task("Read-BuildArtifacts") - .Does(() => -{ - // var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - // var artifacts = build.GetArtifacts(); - // if (!artifacts.Any()) - // { - // Information("No artifacts found."); - // } - // else - // { - // foreach (var artifact in artifacts) - // { - // Information("{0}: {1}", artifact.Id, artifact.Name); - // } - // } -}); - -Task("Read-BuildTestRuns") - .Does(() => -{ - // var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken(); - - // var testRuns = build.GetTestRuns(); - // if (!testRuns.Any()) - // { - // Information("No test runs found."); - // } - // else - // { - // foreach (var testRun in testRuns) - // { - // Information("{0}", testRun.RunId); - // } - // } -}); - -Task("Read-PullRequest") - .WithCriteria((context) => context.BuildSystem().IsPullRequest, "Only supported for pull request builds.") - .Does(() => -{ - // var pullRequest = - // AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken(); - - // Information(pullRequest.TargetRefName); -}); - - -Task("Default") - .IsDependentOn("Read-Build") - .IsDependentOn("Read-BuildChanges") - .IsDependentOn("Read-BuildTimelineRecords") - .IsDependentOn("Read-BuildArtifacts") - .IsDependentOn("Read-BuildTestRuns") - .IsDependentOn("Read-PullRequest"); - -////////////////////////////////////////////////// -// EXECUTION -////////////////////////////////////////////////// - -RunTarget(target); \ No newline at end of file diff --git a/tests/script-runner/net7.0/build.ps1 b/tests/script-runner/net7.0/build.ps1 deleted file mode 100644 index fe602768..00000000 --- a/tests/script-runner/net7.0/build.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -$ErrorActionPreference = 'Stop' - -$SCRIPT_NAME = "build.cake" - -Write-Host "Restoring .NET Core tools" -dotnet tool restore -if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - -Write-Host "Bootstrapping Cake" -dotnet cake $SCRIPT_NAME --bootstrap -if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - -Write-Host "Running Build" -dotnet cake $SCRIPT_NAME @args -if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } \ No newline at end of file diff --git a/tests/script-runner/net7.0/build.sh b/tests/script-runner/net7.0/build.sh deleted file mode 100755 index 921a3241..00000000 --- a/tests/script-runner/net7.0/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -SCRIPT_NAME="build.cake" - -echo "Restoring .NET Core tools" -dotnet tool restore - -echo "Bootstrapping Cake" -dotnet cake $SCRIPT_NAME --bootstrap - -echo "Running Build" -dotnet cake $SCRIPT_NAME "$@" \ No newline at end of file diff --git a/tests/script-runner/net7.0/global.json b/tests/script-runner/net7.0/global.json deleted file mode 100644 index e9812526..00000000 --- a/tests/script-runner/net7.0/global.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sdk": { - "allowPrerelease": true, - "version": "7.0.100", - "rollForward": "latestFeature" - } -} \ No newline at end of file diff --git a/tests/script-runner/net7.0/nuget.config b/tests/script-runner/net7.0/nuget.config deleted file mode 100644 index 62768c3d..00000000 --- a/tests/script-runner/net7.0/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/script-runner/net8.0/.config/dotnet-tools.json b/tests/script-runner/net8.0/.config/dotnet-tools.json index 7b346950..f92efc2b 100644 --- a/tests/script-runner/net8.0/.config/dotnet-tools.json +++ b/tests/script-runner/net8.0/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "4.0.0", + "version": "5.0.0", "commands": [ "dotnet-cake" ] diff --git a/tests/script-runner/net8.0/global.json b/tests/script-runner/net8.0/global.json index 3660ff88..db28d4c7 100644 --- a/tests/script-runner/net8.0/global.json +++ b/tests/script-runner/net8.0/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": true, - "version": "8.0.100", + "version": "8.0.404", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/tests/script-runner/net7.0/.config/dotnet-tools.json b/tests/script-runner/net9.0/.config/dotnet-tools.json similarity index 84% rename from tests/script-runner/net7.0/.config/dotnet-tools.json rename to tests/script-runner/net9.0/.config/dotnet-tools.json index 7b346950..f92efc2b 100644 --- a/tests/script-runner/net7.0/.config/dotnet-tools.json +++ b/tests/script-runner/net9.0/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "4.0.0", + "version": "5.0.0", "commands": [ "dotnet-cake" ] diff --git a/tests/script-runner/net6.0/build.cake b/tests/script-runner/net9.0/build.cake similarity index 100% rename from tests/script-runner/net6.0/build.cake rename to tests/script-runner/net9.0/build.cake diff --git a/tests/script-runner/net6.0/build.ps1 b/tests/script-runner/net9.0/build.ps1 similarity index 100% rename from tests/script-runner/net6.0/build.ps1 rename to tests/script-runner/net9.0/build.ps1 diff --git a/tests/script-runner/net6.0/build.sh b/tests/script-runner/net9.0/build.sh similarity index 100% rename from tests/script-runner/net6.0/build.sh rename to tests/script-runner/net9.0/build.sh diff --git a/tests/frosting/net6.0/global.json b/tests/script-runner/net9.0/global.json similarity index 75% rename from tests/frosting/net6.0/global.json rename to tests/script-runner/net9.0/global.json index c31f98b7..5110c037 100644 --- a/tests/frosting/net6.0/global.json +++ b/tests/script-runner/net9.0/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": true, - "version": "6.0.100", + "version": "9.0.100", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/tests/script-runner/net6.0/nuget.config b/tests/script-runner/net9.0/nuget.config similarity index 100% rename from tests/script-runner/net6.0/nuget.config rename to tests/script-runner/net9.0/nuget.config