From 1cb2500729ed9c0268bba411dab9b4a804ce242f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 12:37:00 +0200 Subject: [PATCH 01/27] Bump xunit from 2.4.1 to 2.4.2 in /src (#271) Bumps [xunit](https://github.com/xunit/xunit) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/xunit/xunit/releases) - [Commits](https://github.com/xunit/xunit/compare/2.4.1...2.4.2) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 47ab5ea..5e63049 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -31,7 +31,7 @@ - + From 7efb5760731d9b4288bc986fa6918923cc9298cb Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 8 Aug 2022 20:42:52 +0000 Subject: [PATCH 02/27] Update to Cake.Recipe 3.0 (#272) --- .appveyor.yml | 2 +- recipe.cake | 13 ++++++++----- tools/packages.config | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8c54926..9a8e52c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,7 +11,7 @@ install: - ps: nuget update -self build_script: - - ps: .\build.ps1 -Target CI + - ps: .\build.ps1 --target=CI # Tests test: off diff --git a/recipe.cake b/recipe.cake index 497553a..7f78d0a 100644 --- a/recipe.cake +++ b/recipe.cake @@ -1,4 +1,8 @@ -#load nuget:?package=Cake.Recipe&version=2.2.1 +#load nuget:?package=Cake.Recipe&version=3.0.0 + +//************************************************************************************************* +// Settings +//************************************************************************************************* Environment.SetVariableNames(); @@ -17,13 +21,12 @@ BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings( context: Context, - dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.MsBuild.Tests/**/*.cs", BuildParameters.RootDirectoryPath + "/src/Cake.Issues.MsBuild*/**/*.AssemblyInfo.cs" }, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[Cake.Issues]* -[Cake.Issues.Testing]* -[Shouldly]* -[Microsoft.Build*]* -[StructuredLogger]* -[DiffEngine]* -[EmptyFiles]*", testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*", testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"); -// Workaround until https://github.com/cake-contrib/Cake.Recipe/issues/862 has been fixed in Cake.Recipe -ToolSettings.SetToolPreprocessorDirectives( - reSharperTools: "#tool nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2021.2.0"); +//************************************************************************************************* +// Execution +//************************************************************************************************* Build.RunDotNetCore(); diff --git a/tools/packages.config b/tools/packages.config index ef49ed4..08d91fc 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,4 +1,4 @@ - + \ No newline at end of file From 56941cdbb9160047c40dae8270e36a3a4460da29 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Tue, 9 Aug 2022 18:11:15 +0000 Subject: [PATCH 03/27] Use Cake .NET tool to run build (#273) --- .config/dotnet-tools.json | 12 ++ build.ps1 | 268 ++------------------------------------ build.sh | 121 ++--------------- tools/packages.config | 4 - 4 files changed, 31 insertions(+), 374 deletions(-) create mode 100644 .config/dotnet-tools.json delete mode 100644 tools/packages.config diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..4903ba5 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "cake.tool": { + "version": "1.3.0", + "commands": [ + "dotnet-cake" + ] + } + } +} \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 285bb72..0940a31 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,261 +1,15 @@ -########################################################################## -# This is the Cake bootstrapper script for PowerShell. -# Based on boostrapper from https://github.com/cake-build/resources -########################################################################## +$ErrorActionPreference = 'Stop' -<# +$SCRIPT_NAME = "recipe.cake" -.SYNOPSIS -This is a Powershell script to bootstrap a Cake build. +Write-Host "Restoring .NET Core tools" +dotnet tool restore +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } -.DESCRIPTION -This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) -and execute your Cake build script with the parameters you provide. +Write-Host "Bootstrapping Cake" +dotnet cake $SCRIPT_NAME --bootstrap +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } -.PARAMETER Script -The build script to execute. -.PARAMETER Target -The build script target to run. -.PARAMETER Configuration -The build configuration to use. -.PARAMETER Verbosity -Specifies the amount of information to be displayed. -.PARAMETER ShowDescription -Shows description about tasks. -.PARAMETER DryRun -Performs a dry run. -.PARAMETER SkipToolPackageRestore -Skips restoring of packages. -.PARAMETER ScriptArgs -Remaining arguments are added here. - -.LINK -https://cakebuild.net - -#> - -[CmdletBinding()] -Param( - [string]$Script = "recipe.cake", - [string]$Target, - [string]$Configuration, - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity, - [switch]$ShowDescription, - [Alias("WhatIf", "Noop")] - [switch]$DryRun, - [switch]$SkipToolPackageRestore, - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs -) - -# Attempt to set highest encryption available for SecurityProtocol. -# PowerShell will not set this by default (until maybe .NET 4.6.x). This -# will typically produce a message for PowerShell v2 (just an info -# message though) -try { - # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) - # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't - # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is - # installed (.NET 4.5 is an in-place upgrade). - # PowerShell Core already has support for TLS 1.2 so we can skip this if running in that. - if (-not $IsCoreCLR) { - [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 - } - } catch { - Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' - } - -[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null -function MD5HashFile([string] $filePath) -{ - if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) - { - return $null - } - - [System.IO.Stream] $file = $null; - [System.Security.Cryptography.MD5] $md5 = $null; - try - { - $md5 = [System.Security.Cryptography.MD5]::Create() - $file = [System.IO.File]::OpenRead($filePath) - return [System.BitConverter]::ToString($md5.ComputeHash($file)) - } - finally - { - if ($file -ne $null) - { - $file.Dispose() - } - } -} - -function GetProxyEnabledWebClient -{ - $wc = New-Object System.Net.WebClient - $proxy = [System.Net.WebRequest]::GetSystemWebProxy() - $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials - $wc.Proxy = $proxy - return $wc -} - -Write-Host "Preparing to run build script..." - -if(!$PSScriptRoot){ - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -$TOOLS_DIR = Join-Path $PSScriptRoot "tools" -$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" -$MODULES_DIR = Join-Path $TOOLS_DIR "Modules" -$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" -$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" -$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" -$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" -$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config" -$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config" - -# Make sure tools folder exists -if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { - Write-Verbose -Message "Creating tools directory..." - New-Item -Path $TOOLS_DIR -Type Directory | Out-Null -} - -# Make sure that packages.config exist. -if (!(Test-Path $PACKAGES_CONFIG)) { - Write-Verbose -Message "Downloading packages.config..." - try { - $wc = GetProxyEnabledWebClient - $wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) - } catch { - Throw "Could not download packages.config." - } -} - -# Try find NuGet.exe in path if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Trying to find nuget.exe in PATH..." - $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } - $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 - if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { - Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." - $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName - } -} - -# Try download NuGet.exe if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Downloading NuGet.exe..." - try { - $wc = GetProxyEnabledWebClient - $wc.DownloadFile($NUGET_URL, $NUGET_EXE) - } catch { - Throw "Could not download NuGet.exe." - } -} - -# Save nuget.exe path to environment to be available to child processed -$env:NUGET_EXE = $NUGET_EXE -$env:NUGET_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { - "mono `"$NUGET_EXE`"" -} else { - "`"$NUGET_EXE`"" -} - -# Restore tools from NuGet? -if(-Not $SkipToolPackageRestore.IsPresent) { - Push-Location - Set-Location $TOOLS_DIR - - # Check for changes in packages.config and remove installed tools if true. - [string] $md5Hash = MD5HashFile $PACKAGES_CONFIG - if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or - ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { - Write-Verbose -Message "Missing or changed package.config hash..." - Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery | - Remove-Item -Recurse -Force - } - - Write-Verbose -Message "Restoring tools from NuGet..." - - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet tools." - } - else - { - $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" - } - Write-Verbose -Message ($NuGetOutput | Out-String) - - Pop-Location -} - -# Restore addins from NuGet -if (Test-Path $ADDINS_PACKAGES_CONFIG) { - Push-Location - Set-Location $ADDINS_DIR - - Write-Verbose -Message "Restoring addins from NuGet..." - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet addins." - } - - Write-Verbose -Message ($NuGetOutput | Out-String) - - Pop-Location -} - -# Restore modules from NuGet -if (Test-Path $MODULES_PACKAGES_CONFIG) { - Push-Location - Set-Location $MODULES_DIR - - Write-Verbose -Message "Restoring modules from NuGet..." - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet modules." - } - - Write-Verbose -Message ($NuGetOutput | Out-String) - - Pop-Location -} - -# Make sure that Cake has been installed. -if (!(Test-Path $CAKE_EXE)) { - Throw "Could not find Cake.exe at $CAKE_EXE" -} - -$CAKE_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { - "mono `"$CAKE_EXE`"" -} else { - "`"$CAKE_EXE`"" -} - - # Build an array (not a string) of Cake arguments to be joined later -$cakeArguments = @() -if ($Script) { $cakeArguments += "`"$Script`"" } -if ($Target) { $cakeArguments += "-target=`"$Target`"" } -if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } -if ($ShowDescription) { $cakeArguments += "-showdescription" } -if ($DryRun) { $cakeArguments += "-dryrun" } -$cakeArguments += $ScriptArgs - -# Bootstrap & start Cake -Write-Host "Bootstrapping Cake..." -Invoke-Expression "& $CAKE_EXE_INVOCATION $Script --bootstrap" -if ($LASTEXITCODE -eq 0) -{ - Write-Host "Running build script..." - Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ")" -} - -exit $LASTEXITCODE \ No newline at end of file +Write-Host "Running Build" +dotnet cake $SCRIPT_NAME @args +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } \ No newline at end of file diff --git a/build.sh b/build.sh index 878a2f2..ba5d0c9 100755 --- a/build.sh +++ b/build.sh @@ -1,116 +1,11 @@ -#!/usr/bin/env bash +#!/bin/bash +SCRIPT_NAME="recipe.cake" -########################################################################## -# This is the Cake bootstrapper script for Linux and OS X. -# Based on bootstrapper from https://github.com/cake-build/resources -########################################################################## +echo "Restoring .NET Core tools" +dotnet tool restore -# Define directories. -SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -TOOLS_DIR=$SCRIPT_DIR/tools -ADDINS_DIR=$TOOLS_DIR/Addins -MODULES_DIR=$TOOLS_DIR/Modules -NUGET_EXE=$TOOLS_DIR/nuget.exe -CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe -PACKAGES_CONFIG=$TOOLS_DIR/packages.config -PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum -ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config -MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config +echo "Bootstrapping Cake" +dotnet cake $SCRIPT_NAME --bootstrap -# Define md5sum or md5 depending on Linux/OSX -MD5_EXE= -if [[ "$(uname -s)" == "Darwin" ]]; then - MD5_EXE="md5 -r" -else - MD5_EXE="md5sum" -fi - -# Define default arguments. -SCRIPT="recipe.cake" -CAKE_ARGUMENTS=() - -# Parse arguments. -for i in "$@"; do - case $1 in - -s|--script) SCRIPT="$2"; shift ;; - --) shift; CAKE_ARGUMENTS+=("$@"); break ;; - *) CAKE_ARGUMENTS+=("$1") ;; - esac - shift -done - -# Make sure the tools folder exist. -if [ ! -d "$TOOLS_DIR" ]; then - mkdir "$TOOLS_DIR" -fi - -# Make sure that packages.config exist. -if [ ! -f "$TOOLS_DIR/packages.config" ]; then - echo "Downloading packages.config..." - curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages - if [ $? -ne 0 ]; then - echo "An error occurred while downloading packages.config." - exit 1 - fi -fi - -# Download NuGet if it does not exist. -if [ ! -f "$NUGET_EXE" ]; then - echo "Downloading NuGet..." - curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - if [ $? -ne 0 ]; then - echo "An error occurred while downloading nuget.exe." - exit 1 - fi -fi - -# Restore tools from NuGet. -pushd "$TOOLS_DIR" >/dev/null -if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then - find . -type d ! -name . ! -name 'Cake.Bakery' | xargs rm -rf -fi - -mono "$NUGET_EXE" install -ExcludeVersion -if [ $? -ne 0 ]; then - echo "Could not restore NuGet tools." - exit 1 -fi - -$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5" - -popd >/dev/null - -# Restore addins from NuGet. -if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then - pushd "$ADDINS_DIR" >/dev/null - - mono "$NUGET_EXE" install -ExcludeVersion - if [ $? -ne 0 ]; then - echo "Could not restore NuGet addins." - exit 1 - fi - - popd >/dev/null -fi - -# Restore modules from NuGet. -if [ -f "$MODULES_PACKAGES_CONFIG" ]; then - pushd "$MODULES_DIR" >/dev/null - - mono "$NUGET_EXE" install -ExcludeVersion - if [ $? -ne 0 ]; then - echo "Could not restore NuGet modules." - exit 1 - fi - - popd >/dev/null -fi - -# Make sure that Cake has been installed. -if [ ! -f "$CAKE_EXE" ]; then - echo "Could not find Cake.exe at '$CAKE_EXE'." - exit 1 -fi - -# Bootstrap & start Cake -(exec mono "$CAKE_EXE" $SCRIPT --bootstrap) && (exec mono "$CAKE_EXE" $SCRIPT "${CAKE_ARGUMENTS[@]}") \ No newline at end of file +echo "Running Build" +dotnet cake $SCRIPT_NAME "$@" \ No newline at end of file diff --git a/tools/packages.config b/tools/packages.config deleted file mode 100644 index 08d91fc..0000000 --- a/tools/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From ed1dbda0f7b49cf26805c55f60a4a36bc3b33f66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Aug 2022 08:33:25 +0200 Subject: [PATCH 04/27] Bump Microsoft.NET.Test.Sdk from 17.2.0 to 17.3.0 in /src (#274) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.2.0 to 17.3.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v17.2.0...v17.3.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 5e63049..7f90cd4 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -24,7 +24,7 @@ - + From 9365622371c81bf1196e94459af5c2474b692f2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Aug 2022 07:52:01 +0200 Subject: [PATCH 05/27] Bump Shouldly from 4.0.3 to 4.1.0 in /src (#275) Bumps [Shouldly](https://github.com/shouldly/shouldly) from 4.0.3 to 4.1.0. - [Release notes](https://github.com/shouldly/shouldly/releases) - [Changelog](https://github.com/shouldly/shouldly/blob/master/BREAKING%20CHANGES.txt) - [Commits](https://github.com/shouldly/shouldly/compare/v4.0.3...4.1.0) --- updated-dependencies: - dependency-name: Shouldly dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 7f90cd4..d7a85d0 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -29,7 +29,7 @@ - + From 765cff44e20699cf5b65252f2cb7fac52e13ee14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 08:07:18 +0200 Subject: [PATCH 06/27] Bump Microsoft.NET.Test.Sdk from 17.3.0 to 17.3.1 in /src (#276) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.3.0 to 17.3.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v17.3.0...v17.3.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index d7a85d0..711b7d2 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -24,7 +24,7 @@ - + From 3247c5fa7ac27ff5f911ac969f07d6613b31e142 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 09:55:22 +0200 Subject: [PATCH 07/27] Bump Microsoft.NET.Test.Sdk from 17.3.1 to 17.3.2 in /src (#277) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.3.1 to 17.3.2. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v17.3.1...v17.3.2) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 711b7d2..8338572 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -24,7 +24,7 @@ - + From 36860f8a7494c5e61a970e85bab1f9ec8cbaa9a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 22:57:51 +0100 Subject: [PATCH 08/27] Bump Microsoft.NET.Test.Sdk from 17.3.2 to 17.4.0 in /src (#278) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.3.2 to 17.4.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](https://github.com/microsoft/vstest/compare/v17.3.2...v17.4.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 8338572..111c610 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -24,7 +24,7 @@ - + From 46b9aff3923ff4b3f275e573e8ff43e895c86f7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 22:24:43 +0000 Subject: [PATCH 09/27] Bump MSBuild.StructuredLogger from 2.1.669 to 2.1.745 in /src (#281) Bumps [MSBuild.StructuredLogger](https://github.com/KirillOsenkov/MSBuildStructuredLog) from 2.1.669 to 2.1.745. - [Release notes](https://github.com/KirillOsenkov/MSBuildStructuredLog/releases) - [Commits](https://github.com/KirillOsenkov/MSBuildStructuredLog/compare/v2.1.669...v2.1.745) --- updated-dependencies: - dependency-name: MSBuild.StructuredLogger dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index c033856..3f67f35 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -25,7 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From c80e32184130e63d099298825fbd6c0cbe603b6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Jan 2023 12:47:02 +0100 Subject: [PATCH 10/27] Bump Microsoft.NET.Test.Sdk from 17.4.0 to 17.4.1 in /src (#284) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.4.0 to 17.4.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.4.0...v17.4.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 04fa5f0..05b60aa 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -24,7 +24,7 @@ - + From 92cc1bbbd8bcc79bf555454b57d17ca3ef01614d Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:16:47 +0000 Subject: [PATCH 11/27] Update target frameworks (#289) --- nuspec/nuget/Cake.Issues.MsBuild.nuspec | 18 ++++++------------ .../Cake.Issues.MsBuild.Tests.csproj | 2 +- .../Cake.Issues.MsBuild.csproj | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/nuspec/nuget/Cake.Issues.MsBuild.nuspec b/nuspec/nuget/Cake.Issues.MsBuild.nuspec index 73a5486..42a100c 100644 --- a/nuspec/nuget/Cake.Issues.MsBuild.nuspec +++ b/nuspec/nuget/Cake.Issues.MsBuild.nuspec @@ -28,23 +28,17 @@ See the Project Site for an overview of the whole ecosystem of addins for workin - - - - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 05b60aa..add3552 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 false Cake.Issues Copyright © BBT Software AG and contributors diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 3f67f35..427a89e 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net5.0;net6.0 + net6.0;net7.0 MsBuild support for the Cake.Issues Addin for Cake Build Automation System BBT Software AG BBT Software AG From dc531959e16bb6d35579e14aac90d66fd506a5da Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:22:43 +0000 Subject: [PATCH 12/27] Update for Cake 3.0 and Cake.Issues 3.0 (#290) * Bump Cake.Core from 2.0.0 to 3.0.0 in /src Bumps [Cake.Core](https://github.com/cake-build/cake) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/cake-build/cake/releases) - [Changelog](https://github.com/cake-build/cake/blob/develop/ReleaseNotes.md) - [Commits](https://github.com/cake-build/cake/compare/v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: Cake.Core dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump Cake.Testing from 2.0.0 to 3.0.0 in /src Bumps [Cake.Testing](https://github.com/cake-build/cake) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/cake-build/cake/releases) - [Changelog](https://github.com/cake-build/cake/blob/develop/ReleaseNotes.md) - [Commits](https://github.com/cake-build/cake/compare/v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: Cake.Testing dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update Cake.Issues to 3.0 Beta 1 Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Cake.Issues.MsBuild.Tests.csproj | 10 +++++----- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index add3552..cad9242 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -25,10 +25,10 @@ - - - - + + + + diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 427a89e..0c284cd 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -19,8 +19,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive From 0584590accc90d0b722d0181103be3fbbab0b2c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Jan 2023 21:23:54 +0100 Subject: [PATCH 13/27] Bump Microsoft.CodeAnalysis.NetAnalyzers from 6.0.0 to 7.0.0 in /src (#282) Bumps [Microsoft.CodeAnalysis.NetAnalyzers](https://github.com/dotnet/roslyn-analyzers) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/dotnet/roslyn-analyzers/releases) - [Changelog](https://github.com/dotnet/roslyn-analyzers/blob/main/PostReleaseActivities.md) - [Commits](https://github.com/dotnet/roslyn-analyzers/compare/6.0.0...7.0.0) --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.NetAnalyzers dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 0c284cd..8bb3d15 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -21,7 +21,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 38581238903464c544d327e487f5cc7fea4c32eb Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:32:19 +0000 Subject: [PATCH 14/27] Fix linting issues (#291) * Add editorconfig file * Fix linting issues --- src/.editorconfig | 226 ++++++++++++++++++ .../BaseMsBuildLogFileFormatTests.cs | 16 +- .../LogFileFormat/BinaryLogFileFormatTests.cs | 2 +- .../XmlFileLoggerLogFileFormatTests.cs | 2 +- .../MsBuildIssuesProviderTests.cs | 4 +- .../MsBuildIssuesSettingsTests.cs | 10 +- .../LogFileFormat/BinaryLogFileFormat.cs | 5 +- .../XmlFileLoggerLogFileFormat.cs | 6 +- .../MsBuildRuleUrlResolver.cs | 5 +- 9 files changed, 249 insertions(+), 27 deletions(-) create mode 100644 src/.editorconfig diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 0000000..bef3dc1 --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,226 @@ +root = true +# Remove the line below if you want to inherit .editorconfig settings from higher directories + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +file_header_template = + +# this. and Me. preferences +dotnet_style_qualification_for_event = true +dotnet_style_qualification_for_field = true +dotnet_style_qualification_for_method = true +dotnet_style_qualification_for_property = true + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = 0 + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = true +dotnet_style_allow_statement_immediately_after_block_experimental = true + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = false +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = false +csharp_style_expression_bodied_methods = false +csharp_style_expression_bodied_operators = false +csharp_style_expression_bodied_properties = true + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async +csharp_style_prefer_readonly_struct = true + +# Code-block preferences +csharp_prefer_braces = true +csharp_prefer_simple_using_statement = false +csharp_style_namespace_declarations = block_scoped +csharp_style_prefer_method_group_conversion = true +csharp_style_prefer_top_level_statements = true + +# Expression-level preferences +csharp_prefer_simple_default_expression = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_null_check_over_type_check = true +csharp_style_prefer_range_operator = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = inside_namespace:error + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true +csharp_style_allow_embedded_statements_on_same_line_experimental = true + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = no_change +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case diff --git a/src/Cake.Issues.MsBuild.Tests/BaseMsBuildLogFileFormatTests.cs b/src/Cake.Issues.MsBuild.Tests/BaseMsBuildLogFileFormatTests.cs index ca738ca..ad6dfad 100644 --- a/src/Cake.Issues.MsBuild.Tests/BaseMsBuildLogFileFormatTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/BaseMsBuildLogFileFormatTests.cs @@ -14,7 +14,7 @@ public void Should_Throw_If_FilePath_Is_Null() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); - string filePath = null; + const string filePath = null; var settings = new RepositorySettings(@"c:\repo"); // When @@ -44,7 +44,7 @@ public void Should_Throw_If_FilePath_Is_WhiteSpace() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); - var filePath = " "; + const string filePath = " "; var settings = new RepositorySettings(@"c:\repo"); // When @@ -59,8 +59,8 @@ public void Should_Throw_If_Settings_Are_Null() { // Given var format = new FakeMsBuildLogFileFormat(new FakeLog()); - var filePath = @"c:\repo\foo.ch"; - RepositorySettings settings = null; + const string filePath = @"c:\repo\foo.ch"; + const RepositorySettings settings = null; // When var result = Record.Exception(() => format.ValidateFilePath(filePath, settings)); @@ -83,10 +83,10 @@ public void Should_Return_Correct_Value_For_Valid( var settings = new RepositorySettings(repoRoot); // When - var result = format.ValidateFilePath(filePath, settings); + var (valid, _) = format.ValidateFilePath(filePath, settings); // Then - result.Valid.ShouldBe(expectedValue); + valid.ShouldBe(expectedValue); } [Theory] @@ -103,10 +103,10 @@ public void Should_Return_Correct_Value_For_FilePath( var settings = new RepositorySettings(repoRoot); // When - var result = format.ValidateFilePath(filePath, settings); + var (_, resultFilePath) = format.ValidateFilePath(filePath, settings); // Then - result.FilePath.ShouldBe(expectedValue); + resultFilePath.ShouldBe(expectedValue); } } } diff --git a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs index b2ded7b..6488a87 100644 --- a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs @@ -16,7 +16,7 @@ public sealed class TheCtor public void Should_Throw_If_Log_Is_Null() { // Given - ICakeLog log = null; + const ICakeLog log = null; // When var result = Record.Exception(() => new BinaryLogFileFormat(log)); diff --git a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs index 6d05345..936290c 100644 --- a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs @@ -17,7 +17,7 @@ public sealed class TheCtor public void Should_Throw_If_Log_Is_Null() { // Given - ICakeLog log = null; + const ICakeLog log = null; // When var result = Record.Exception(() => new XmlFileLoggerLogFileFormat(log)); diff --git a/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesProviderTests.cs b/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesProviderTests.cs index c55b62b..fe45a54 100644 --- a/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesProviderTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesProviderTests.cs @@ -14,7 +14,7 @@ public sealed class TheCtor public void Should_Throw_If_Log_Is_Null() { // Given - ICakeLog log = null; + const ICakeLog log = null; var settings = new MsBuildIssuesSettings( "Foo".ToByteArray(), @@ -32,7 +32,7 @@ public void Should_Throw_If_IssueProviderSettings_Are_Null() { // Given var log = new FakeLog(); - MsBuildIssuesSettings settings = null; + const MsBuildIssuesSettings settings = null; // When var result = Record.Exception(() => new MsBuildIssuesProvider(log, settings)); diff --git a/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesSettingsTests.cs b/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesSettingsTests.cs index bcd1a22..ef31b6f 100644 --- a/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesSettingsTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/MsBuildIssuesSettingsTests.cs @@ -16,7 +16,7 @@ public sealed class TheCtor public void Should_Throw_If_LogFilePath_Is_Null() { // Given - FilePath logFilePath = null; + const FilePath logFilePath = null; var format = new XmlFileLoggerLogFileFormat(new FakeLog()); // When @@ -30,7 +30,7 @@ public void Should_Throw_If_LogFilePath_Is_Null() public void Should_Throw_If_Format_For_LogFilePath_Is_Null() { // Given - BaseMsBuildLogFileFormat format = null; + const BaseMsBuildLogFileFormat format = null; using (var tempFile = new ResourceTempFile("Cake.Issues.MsBuild.Tests.Testfiles.XmlFileLoggerLogFileFormat.FullLog.xml")) { @@ -47,7 +47,7 @@ public void Should_Throw_If_Format_For_LogFilePath_Is_Null() public void Should_Throw_If_LogFileContent_Is_Null() { // Given - byte[] logFileContent = null; + const byte[] logFileContent = null; var format = new XmlFileLoggerLogFileFormat(new FakeLog()); // When @@ -62,7 +62,7 @@ public void Should_Throw_If_Format_For_LogFileContent_Is_Null() { // Given var logFileContent = "foo".ToByteArray(); - BaseMsBuildLogFileFormat format = null; + const BaseMsBuildLogFileFormat format = null; // When var result = Record.Exception(() => @@ -90,7 +90,7 @@ public void Should_Set_LogFileContent() public void Should_Set_LogFileContent_If_Empty() { // Given - byte[] logFileContent = Array.Empty(); + var logFileContent = Array.Empty(); var format = new XmlFileLoggerLogFileFormat(new FakeLog()); // When diff --git a/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs b/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs index 0642180..6251826 100644 --- a/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs +++ b/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs @@ -2,6 +2,7 @@ { using System; using System.Collections.Generic; + using System.Linq; using Cake.Core.Diagnostics; using Microsoft.Build.Framework; using Microsoft.Build.Logging.StructuredLogger; @@ -39,10 +40,8 @@ public override IEnumerable ReadIssues( var result = new List(); var binLogReader = new BinLogReader(); - foreach (var record in binLogReader.ReadRecords(issueProviderSettings.LogFileContent)) + foreach (var buildEventArgs in binLogReader.ReadRecords(issueProviderSettings.LogFileContent).Select(x => x.Args)) { - var buildEventArgs = record.Args; - IIssue issue = null; if (buildEventArgs is BuildErrorEventArgs buildError) { diff --git a/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs b/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs index fa750cc..295c671 100644 --- a/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs +++ b/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs @@ -153,8 +153,7 @@ private bool TryGetProject( } // Validate project path and make relative to repository root. - bool result; - (result, project) = this.ValidateFilePath(project, repositorySettings); + (var result, project) = this.ValidateFilePath(project, repositorySettings); return result; } @@ -202,8 +201,7 @@ private bool TryGetFile( } // Validate file path and make relative to repository root. - bool result; - (result, fileName) = this.ValidateFilePath(fileName, repositorySettings); + (var result, fileName) = this.ValidateFilePath(fileName, repositorySettings); return result; } diff --git a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs index 3d0ac01..f8d81cf 100644 --- a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs +++ b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs @@ -9,7 +9,7 @@ internal class MsBuildRuleUrlResolver : BaseRuleUrlResolver { private static readonly Lazy InstanceValue = - new Lazy(() => new MsBuildRuleUrlResolver()); + new (() => new MsBuildRuleUrlResolver()); /// /// Initializes a new instance of the class. @@ -58,8 +58,7 @@ protected override bool TryGetRuleDescription(string rule, MsBuildRuleDescriptio } // Try to parse the part after the first number to an integer. - int ruleId; - if (!int.TryParse(rule.Substring(digitIndex), out ruleId)) + if (!int.TryParse(rule.AsSpan(digitIndex), out var ruleId)) { return false; } From 2e00d78f32d8c4dfe24fd0edb5469cf371acb7eb Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:41:59 +0000 Subject: [PATCH 15/27] Add rule for resolving SonarLint rules (#294) --- .../MsBuildRuleUrlResolverTests.cs | 1 + src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs b/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs index d2aaa11..403dd90 100644 --- a/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs @@ -42,6 +42,7 @@ public void Should_Throw_If_Rule_Is_WhiteSpace() [Theory] [InlineData("CA2201", "https://www.google.com/search?q=\"CA2201:\"+site:docs.microsoft.com")] [InlineData("SA1652", "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1652.md")] + [InlineData("S1075", "https://rules.sonarsource.com/csharp/RSPEC-1075")] public void Should_Resolve_Url(string rule, string expectedUrl) { // Given diff --git a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs index f8d81cf..398884f 100644 --- a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs +++ b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs @@ -17,14 +17,24 @@ internal class MsBuildRuleUrlResolver : BaseRuleUrlResolver x.Category.ToUpperInvariant() == "CA" ? new Uri("https://www.google.com/search?q=%22" + x.Rule + ":%22+site:docs.microsoft.com") : null); + + // StyleCop analyzer rules this.AddUrlResolver(x => x.Category.ToUpperInvariant() == "SA" ? new Uri("https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/" + x.Rule + ".md") : null); + + // SonarLint rules + this.AddUrlResolver(x => + x.Category.ToUpperInvariant() == "S" ? + new Uri("https://rules.sonarsource.com/csharp/RSPEC-" + x.RuleId) : + null); } /// From bed07e8e18e79253bc9f8282068e759647275433 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:42:38 +0000 Subject: [PATCH 16/27] Remove dupFinder exclusions (#292) --- .../LogFileFormat/BinaryLogFileFormat.cs | 6 ------ .../LogFileFormat/XmlFileLoggerLogFileFormat.cs | 6 ------ 2 files changed, 12 deletions(-) diff --git a/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs b/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs index 6251826..752d58b 100644 --- a/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs +++ b/src/Cake.Issues.MsBuild/LogFileFormat/BinaryLogFileFormat.cs @@ -27,16 +27,10 @@ public override IEnumerable ReadIssues( IRepositorySettings repositorySettings, MsBuildIssuesSettings issueProviderSettings) { -#pragma warning disable SA1123 // Do not place regions within elements - #region DupFinder Exclusion -#pragma warning restore SA1123 // Do not place regions within elements - issueProvider.NotNull(nameof(issueProvider)); repositorySettings.NotNull(nameof(repositorySettings)); issueProviderSettings.NotNull(nameof(issueProviderSettings)); - #endregion - var result = new List(); var binLogReader = new BinLogReader(); diff --git a/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs b/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs index 295c671..e61df4b 100644 --- a/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs +++ b/src/Cake.Issues.MsBuild/LogFileFormat/XmlFileLoggerLogFileFormat.cs @@ -27,16 +27,10 @@ public override IEnumerable ReadIssues( IRepositorySettings repositorySettings, MsBuildIssuesSettings issueProviderSettings) { -#pragma warning disable SA1123 // Do not place regions within elements - #region DupFinder Exclusion -#pragma warning restore SA1123 // Do not place regions within elements - issueProvider.NotNull(nameof(issueProvider)); repositorySettings.NotNull(nameof(repositorySettings)); issueProviderSettings.NotNull(nameof(issueProviderSettings)); - #endregion - var result = new List(); // Read log file. From c1a229b13da3c2d06091115bbc96af12e9ed0082 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:57:00 +0000 Subject: [PATCH 17/27] Add rule for resolving Roslynator rules (#296) --- .../MsBuildRuleUrlResolverTests.cs | 1 + src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs b/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs index 403dd90..d7f8f26 100644 --- a/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs @@ -43,6 +43,7 @@ public void Should_Throw_If_Rule_Is_WhiteSpace() [InlineData("CA2201", "https://www.google.com/search?q=\"CA2201:\"+site:docs.microsoft.com")] [InlineData("SA1652", "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1652.md")] [InlineData("S1075", "https://rules.sonarsource.com/csharp/RSPEC-1075")] + [InlineData("RCS1001", "https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1001.md")] public void Should_Resolve_Url(string rule, string expectedUrl) { // Given diff --git a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs index 398884f..a988d45 100644 --- a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs +++ b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs @@ -35,6 +35,12 @@ private MsBuildRuleUrlResolver() x.Category.ToUpperInvariant() == "S" ? new Uri("https://rules.sonarsource.com/csharp/RSPEC-" + x.RuleId) : null); + + // Roslynator rules + this.AddUrlResolver(x => + x.Category.ToUpperInvariant() == "RCS" ? + new Uri("https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/" + x.Rule + ".md") : + null); } /// From 5b0f998b031f4f52d1b5da97becd723676eea943 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 20:57:16 +0000 Subject: [PATCH 18/27] Resolve CA issues to learn.microsoft.com (#298) --- .../LogFileFormat/BinaryLogFileFormatTests.cs | 8 ++++---- .../XmlFileLoggerLogFileFormatTests.cs | 14 +++++++------- .../MsBuildRuleUrlResolverTests.cs | 2 +- src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs index 6488a87..9df309f 100644 --- a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/BinaryLogFileFormatTests.cs @@ -199,7 +199,7 @@ public void Should_Read_Full_Log_Correct() "Cake.Issues.MsBuild.MsBuildIssuesProvider", "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") - .OfRule("CA2210", new Uri("https://www.google.com/search?q=\"CA2210:\"+site:docs.microsoft.com")) + .OfRule("CA2210", new Uri("https://www.google.com/search?q=\"CA2210:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[16], @@ -208,7 +208,7 @@ public void Should_Read_Full_Log_Correct() "Cake.Issues.MsBuild.MsBuildIssuesProvider", "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") - .OfRule("CA1014", new Uri("https://www.google.com/search?q=\"CA1014:\"+site:docs.microsoft.com")) + .OfRule("CA1014", new Uri("https://www.google.com/search?q=\"CA1014:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[17], @@ -218,7 +218,7 @@ public void Should_Read_Full_Log_Correct() "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") .InFile(@"src\ClassLibrary1\Class1.cs", 12) - .OfRule("CA1822", new Uri("https://www.google.com/search?q=\"CA1822:\"+site:docs.microsoft.com")) + .OfRule("CA1822", new Uri("https://www.google.com/search?q=\"CA1822:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[18], @@ -228,7 +228,7 @@ public void Should_Read_Full_Log_Correct() "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") .InFile(@"src\ClassLibrary1\Class1.cs", 13) - .OfRule("CA1804", new Uri("https://www.google.com/search?q=\"CA1804:\"+site:docs.microsoft.com")) + .OfRule("CA1804", new Uri("https://www.google.com/search?q=\"CA1804:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); } } diff --git a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs index 936290c..bddb625 100644 --- a/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/LogFileFormat/XmlFileLoggerLogFileFormatTests.cs @@ -197,7 +197,7 @@ public void Should_Read_Full_Log_Correct() "Cake.Issues.MsBuild.MsBuildIssuesProvider", "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") - .OfRule("CA2210", new Uri("https://www.google.com/search?q=\"CA2210:\"+site:docs.microsoft.com")) + .OfRule("CA2210", new Uri("https://www.google.com/search?q=\"CA2210:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[16], @@ -206,7 +206,7 @@ public void Should_Read_Full_Log_Correct() "Cake.Issues.MsBuild.MsBuildIssuesProvider", "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") - .OfRule("CA1014", new Uri("https://www.google.com/search?q=\"CA1014:\"+site:docs.microsoft.com")) + .OfRule("CA1014", new Uri("https://www.google.com/search?q=\"CA1014:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[17], @@ -216,7 +216,7 @@ public void Should_Read_Full_Log_Correct() "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") .InFile(@"src\ClassLibrary1\Class1.cs", 12) - .OfRule("CA1822", new Uri("https://www.google.com/search?q=\"CA1822:\"+site:docs.microsoft.com")) + .OfRule("CA1822", new Uri("https://www.google.com/search?q=\"CA1822:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[18], @@ -226,7 +226,7 @@ public void Should_Read_Full_Log_Correct() "MSBuild") .InProject(@"src\ClassLibrary1\ClassLibrary1.csproj", "ClassLibrary1") .InFile(@"src\ClassLibrary1\Class1.cs", 13) - .OfRule("CA1804", new Uri("https://www.google.com/search?q=\"CA1804:\"+site:docs.microsoft.com")) + .OfRule("CA1804", new Uri("https://www.google.com/search?q=\"CA1804:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); } @@ -249,7 +249,7 @@ public void Should_Read_Issue_With_File_Correct() "MSBuild") .InProjectOfName(string.Empty) .InFile(@"src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs", 1311) - .OfRule("CA2201", new Uri("https://www.google.com/search?q=\"CA2201:\"+site:docs.microsoft.com")) + .OfRule("CA2201", new Uri("https://www.google.com/search?q=\"CA2201:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); } @@ -317,7 +317,7 @@ public void Should_Read_Issue_Without_File_Correct() "Cake.Issues.MsBuild.MsBuildIssuesProvider", "MSBuild") .InProjectOfName(string.Empty) - .OfRule("CA1711", new Uri("https://www.google.com/search?q=\"CA1711:\"+site:docs.microsoft.com")) + .OfRule("CA1711", new Uri("https://www.google.com/search?q=\"CA1711:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); } @@ -445,7 +445,7 @@ public void Should_Read_Both_Warnings_And_Errors() "MSBuild") .InProjectOfName(string.Empty) .InFile(@"src\Cake.Issues.MsBuild.Tests\MsBuildIssuesProviderTests.cs", 1311) - .OfRule("CA2201", new Uri("https://www.google.com/search?q=\"CA2201:\"+site:docs.microsoft.com")) + .OfRule("CA2201", new Uri("https://www.google.com/search?q=\"CA2201:\"+site:learn.microsoft.com")) .WithPriority(IssuePriority.Warning)); IssueChecker.Check( issues[1], diff --git a/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs b/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs index d7f8f26..2001904 100644 --- a/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs +++ b/src/Cake.Issues.MsBuild.Tests/MsBuildRuleUrlResolverTests.cs @@ -40,7 +40,7 @@ public void Should_Throw_If_Rule_Is_WhiteSpace() } [Theory] - [InlineData("CA2201", "https://www.google.com/search?q=\"CA2201:\"+site:docs.microsoft.com")] + [InlineData("CA2201", "https://www.google.com/search?q=\"CA2201:\"+site:learn.microsoft.com")] [InlineData("SA1652", "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1652.md")] [InlineData("S1075", "https://rules.sonarsource.com/csharp/RSPEC-1075")] [InlineData("RCS1001", "https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1001.md")] diff --git a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs index a988d45..a0022be 100644 --- a/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs +++ b/src/Cake.Issues.MsBuild/MsBuildRuleUrlResolver.cs @@ -21,7 +21,7 @@ private MsBuildRuleUrlResolver() // .NET SDK analyzers this.AddUrlResolver(x => x.Category.ToUpperInvariant() == "CA" ? - new Uri("https://www.google.com/search?q=%22" + x.Rule + ":%22+site:docs.microsoft.com") : + new Uri("https://www.google.com/search?q=%22" + x.Rule + ":%22+site:learn.microsoft.com") : null); // StyleCop analyzer rules From b0001a2c89ee27ea22bdb4fe51ce30779e63c7da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Jan 2023 22:00:33 +0100 Subject: [PATCH 19/27] Bump MSBuild.StructuredLogger from 2.1.745 to 2.1.758 in /src (#285) Bumps [MSBuild.StructuredLogger](https://github.com/KirillOsenkov/MSBuildStructuredLog) from 2.1.745 to 2.1.758. - [Release notes](https://github.com/KirillOsenkov/MSBuildStructuredLog/releases) - [Commits](https://github.com/KirillOsenkov/MSBuildStructuredLog/compare/v2.1.745...v2.1.758) --- updated-dependencies: - dependency-name: MSBuild.StructuredLogger dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 8bb3d15..3cd236f 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -25,7 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 5b7074b52bf68b9cdeb0ff5fdb68408e033394dc Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Sun, 8 Jan 2023 22:02:40 +0100 Subject: [PATCH 20/27] Update release notes link --- nuspec/nuget/Cake.Issues.MsBuild.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuspec/nuget/Cake.Issues.MsBuild.nuspec b/nuspec/nuget/Cake.Issues.MsBuild.nuspec index 42a100c..ab3dd0d 100644 --- a/nuspec/nuget/Cake.Issues.MsBuild.nuspec +++ b/nuspec/nuget/Cake.Issues.MsBuild.nuspec @@ -24,7 +24,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin Copyright © BBT Software AG and contributors cake cake-addin cake-issues cake-issueprovider code-analysis linting msbuild - https://github.com/cake-contrib/Cake.Issues.MsBuild/releases/tag/2.0.0 + https://github.com/cake-contrib/Cake.Issues.MsBuild/releases/tag/3.0.0 From 7746248b26875a72d04ae3fd261b0d7b04c3c6c9 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Thu, 22 Jun 2023 07:13:44 +0200 Subject: [PATCH 21/27] Install required .NET versions --- .appveyor.yml | 16 +++++++++++++--- azure-pipelines.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 9a8e52c..ea35c16 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,11 +4,21 @@ image: Visual Studio 2022 #---------------------------------# -# Build Script # +# Install .NET # #---------------------------------# install: - # Update to latest NuGet version since we require 5.3.0 for embedded icon - - ps: nuget update -self + - ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk" + - 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.405 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.102 -InstallDir $env:DOTNET_INSTALL_DIR' + - ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path" + - ps: dotnet --info + +#---------------------------------# +# Build Script # +#---------------------------------# build_script: - ps: .\build.ps1 --target=CI diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c2b96e3..725f28f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,5 +14,18 @@ jobs: pool: vmImage: 'windows-2022' 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' - powershell: ./build.ps1 displayName: 'Cake Build' \ No newline at end of file From 7f9abaca9b873092933c5ba73ff894aa5bfc75cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 24 Jun 2023 22:13:18 +0000 Subject: [PATCH 22/27] Update Cake.Issues to v3.0.0-beta0002 --- .../Cake.Issues.MsBuild.Tests.csproj | 4 ++-- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index cad9242..3089d0f 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -27,8 +27,8 @@ - - + + diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 3cd236f..f4c6575 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -20,7 +20,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 05901978917ea16558cf13a76b75205dd75ca6c3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 14:58:42 +0200 Subject: [PATCH 23/27] Update Cake.Issues to v3.0.0 (#322) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .../Cake.Issues.MsBuild.Tests.csproj | 4 ++-- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 3089d0f..0944f97 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -27,8 +27,8 @@ - - + + diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index f4c6575..905e464 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -20,7 +20,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 90d337dc558c5857a89c45f46bfc7a3ad294b8f9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:11:22 +0200 Subject: [PATCH 24/27] Update dependency MSBuild.StructuredLogger to v2.1.820 (#319) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 905e464..417b93c 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -25,7 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 2ec312eaa82bf315c3da3785f6fb00163d2a4db3 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Thu, 13 Jul 2023 15:51:44 +0200 Subject: [PATCH 25/27] Run tests on .NET 6 and .NET 7 --- src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj index 0944f97..fc7519c 100644 --- a/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj +++ b/src/Cake.Issues.MsBuild.Tests/Cake.Issues.MsBuild.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0 false Cake.Issues Copyright © BBT Software AG and contributors From 717c1aff7bd44d92626a68c35c1448aa3a47e57f Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Thu, 13 Jul 2023 17:04:05 +0200 Subject: [PATCH 26/27] Downgrade MsBuildStructuredLogger to 2.1.815 2.18.820 throws an exception when tests are running on net6.0. See https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/692 --- src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj index 417b93c..f5a838d 100644 --- a/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj +++ b/src/Cake.Issues.MsBuild/Cake.Issues.MsBuild.csproj @@ -25,7 +25,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From 25a1dfee849af4dcc93915716f81728c2b81474e Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Thu, 13 Jul 2023 17:40:35 +0200 Subject: [PATCH 27/27] Disable posting to Gitter on release --- recipe.cake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe.cake b/recipe.cake index 7f78d0a..af04002 100644 --- a/recipe.cake +++ b/recipe.cake @@ -14,7 +14,8 @@ BuildParameters.SetParameters( repositoryOwner: "cake-contrib", repositoryName: "Cake.Issues.MsBuild", appVeyorAccountName: "cakecontrib", - shouldRunCoveralls: false, // Disabled because it's currently failing + shouldRunCoveralls: false, // Disabled because it's currently failing + shouldPostToGitter: false, // Disabled because it's currently failing shouldGenerateDocumentation: false); BuildParameters.PrintParameters(Context);