From f17518be33e4b76fafc8f4b3a6096aa00ca8ceb1 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 9 Feb 2023 16:46:32 -0700 Subject: [PATCH 01/45] Update the dotnet-install.ps1 script This enables downloading newer SDK versions. --- tools/Install-DotNetSdk.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 2bac3b9..a71ff3f 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -234,10 +234,10 @@ if ($IncludeX86) { } if ($IsMacOS -or $IsLinux) { - $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/781752509a890ca7520f1182e8bae71f9a53d754/src/dotnet-install.sh" + $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/88bd34f089b8a023e3523f22c92abd0ab88e4409/src/dotnet-install.sh" $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.sh" } else { - $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/781752509a890ca7520f1182e8bae71f9a53d754/src/dotnet-install.ps1" + $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/88bd34f089b8a023e3523f22c92abd0ab88e4409/src/dotnet-install.ps1" $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.ps1" } From 551183c1e900d30e0e8b7623c910be160a690b4e Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 9 Feb 2023 16:52:41 -0700 Subject: [PATCH 02/45] Improve error message for unsupported versions --- tools/Install-DotNetSdk.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index a71ff3f..14f4c8c 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -98,7 +98,12 @@ Function Get-InstallerExe( [string]$sku ) { # Get the latest/actual version for the specified one - $TypedVersion = [Version]$Version + $TypedVersion = $null + if (![Version]::TryParse($Version, [ref] $TypedVersion)) { + Write-Error "Unable to parse $Version into an a.b.c.d version. This version cannot be installed machine-wide." + exit 1 + } + if ($TypedVersion.Build -eq -1) { $versionInfo = -Split (Invoke-WebRequest -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sku/$Version/latest.version" -UseBasicParsing) $Version = $versionInfo[-1] From 8381192a53608e7a655dfaf4f58a6edf64f8fa76 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 9 Feb 2023 17:00:31 -0700 Subject: [PATCH 03/45] Remove references to "Core" in .NET Core --- tools/Install-DotNetSdk.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 14f4c8c..47ccf22 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -3,7 +3,7 @@ <# .SYNOPSIS Installs the .NET SDK specified in the global.json file at the root of this repository, - along with supporting .NET Core runtimes used for testing. + along with supporting .NET runtimes used for testing. .DESCRIPTION This MAY not require elevation, as the SDK and runtimes are installed locally to this repo location, unless `-InstallLocality machine` is specified. @@ -43,7 +43,7 @@ if (!$arch) { # Windows Powershell leaves this blank if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { $arch = 'ARM64' } } -# Search for all .NET Core runtime versions referenced from MSBuild projects and arrange to install them. +# Search for all .NET runtime versions referenced from MSBuild projects and arrange to install them. $runtimeVersions = @() $windowsDesktopRuntimeVersions = @() Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% { @@ -145,9 +145,9 @@ Function Get-InstallerExe( } Function Install-DotNet($Version, $Architecture, [ValidateSet('Sdk','Runtime','WindowsDesktop')][string]$sku = 'Sdk') { - Write-Host "Downloading .NET Core $sku $Version..." + Write-Host "Downloading .NET $sku $Version..." $Installer = Get-InstallerExe -Version $Version -Architecture $Architecture -sku $sku - Write-Host "Installing .NET Core $sku $Version..." + Write-Host "Installing .NET $sku $Version..." cmd /c start /wait $Installer /install /passive /norestart if ($LASTEXITCODE -eq 3010) { Write-Verbose "Restart required" @@ -290,7 +290,7 @@ if ($IncludeX86) { $dotnetRuntimeSwitches = $switches + '-Runtime','dotnet' $runtimeVersions | Sort-Object -Unique |% { - if ($PSCmdlet.ShouldProcess(".NET Core $Arch runtime $_", "Install")) { + if ($PSCmdlet.ShouldProcess(".NET $Arch runtime $_", "Install")) { $anythingInstalled = $true Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $dotnetRuntimeSwitches" @@ -303,7 +303,7 @@ $runtimeVersions | Sort-Object -Unique |% { } if ($IncludeX86) { - if ($PSCmdlet.ShouldProcess(".NET Core x86 runtime $_", "Install")) { + if ($PSCmdlet.ShouldProcess(".NET x86 runtime $_", "Install")) { $anythingInstalled = $true Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $dotnetRuntimeSwitches" @@ -320,7 +320,7 @@ $runtimeVersions | Sort-Object -Unique |% { $windowsDesktopRuntimeSwitches = $switches + '-Runtime','windowsdesktop' $windowsDesktopRuntimeVersions | Sort-Object -Unique |% { - if ($PSCmdlet.ShouldProcess(".NET Core WindowsDesktop $arch runtime $_", "Install")) { + if ($PSCmdlet.ShouldProcess(".NET WindowsDesktop $arch runtime $_", "Install")) { $anythingInstalled = $true Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $windowsDesktopRuntimeSwitches" @@ -333,7 +333,7 @@ $windowsDesktopRuntimeVersions | Sort-Object -Unique |% { } if ($IncludeX86) { - if ($PSCmdlet.ShouldProcess(".NET Core WindowsDesktop x86 runtime $_", "Install")) { + if ($PSCmdlet.ShouldProcess(".NET WindowsDesktop x86 runtime $_", "Install")) { $anythingInstalled = $true Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $windowsDesktopRuntimeSwitches" @@ -352,5 +352,5 @@ if ($PSCmdlet.ShouldProcess("Set DOTNET environment variables to discover these } if ($anythingInstalled -and ($InstallLocality -ne 'machine') -and !$env:TF_BUILD -and !$env:GITHUB_ACTIONS) { - Write-Warning ".NET Core runtimes or SDKs were installed to a non-machine location. Perform your builds or open Visual Studio from this same environment in order for tools to discover the location of these dependencies." + Write-Warning ".NET runtimes or SDKs were installed to a non-machine location. Perform your builds or open Visual Studio from this same environment in order for tools to discover the location of these dependencies." } From d19033347c00cf09ef9201a6a4d25a19673d8de4 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 9 Feb 2023 17:07:26 -0700 Subject: [PATCH 04/45] Add -SdkOnly switch --- tools/Install-DotNetSdk.ps1 | 53 ++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 47ccf22..39e47eb 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -15,6 +15,8 @@ When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used. Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`. Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it. +.PARAMETER SdkOnly + Skips installing the runtime. .PARAMETER IncludeX86 Installs a x86 SDK and runtimes in addition to the x64 ones. Only supported on Windows. Ignored on others. #> @@ -22,6 +24,7 @@ Param ( [ValidateSet('repo','user','machine')] [string]$InstallLocality='user', + [switch]$SdkOnly, [switch]$IncludeX86 ) @@ -46,34 +49,36 @@ if (!$arch) { # Windows Powershell leaves this blank # Search for all .NET runtime versions referenced from MSBuild projects and arrange to install them. $runtimeVersions = @() $windowsDesktopRuntimeVersions = @() -Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% { - $projXml = [xml](Get-Content -Path $_) - $pg = $projXml.Project.PropertyGroup - if ($pg) { - $targetFrameworks = @() - $tf = $pg.TargetFramework - $targetFrameworks += $tf - $tfs = $pg.TargetFrameworks - if ($tfs) { - $targetFrameworks = $tfs -Split ';' +if (!$SdkOnly) { + Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% { + $projXml = [xml](Get-Content -Path $_) + $pg = $projXml.Project.PropertyGroup + if ($pg) { + $targetFrameworks = @() + $tf = $pg.TargetFramework + $targetFrameworks += $tf + $tfs = $pg.TargetFrameworks + if ($tfs) { + $targetFrameworks = $tfs -Split ';' + } } - } - $targetFrameworks |? { $_ -match 'net(?:coreapp)?(\d+\.\d+)' } |% { - $v = $Matches[1] - $runtimeVersions += $v - if ($v -ge '3.0' -and -not ($IsMacOS -or $IsLinux)) { - $windowsDesktopRuntimeVersions += $v + $targetFrameworks |? { $_ -match 'net(?:coreapp)?(\d+\.\d+)' } |% { + $v = $Matches[1] + $runtimeVersions += $v + if ($v -ge '3.0' -and -not ($IsMacOS -or $IsLinux)) { + $windowsDesktopRuntimeVersions += $v + } } - } - # Add target frameworks of the form: netXX - $targetFrameworks |? { $_ -match 'net(\d+\.\d+)' } |% { - $v = $Matches[1] - $runtimeVersions += $v - if (-not ($IsMacOS -or $IsLinux)) { - $windowsDesktopRuntimeVersions += $v + # Add target frameworks of the form: netXX + $targetFrameworks |? { $_ -match 'net(\d+\.\d+)' } |% { + $v = $Matches[1] + $runtimeVersions += $v + if (-not ($IsMacOS -or $IsLinux)) { + $windowsDesktopRuntimeVersions += $v + } } - } + } } Function Get-FileFromWeb([Uri]$Uri, $OutDir) { From fb2395d9a7cc483f5f1a37a82b104fde93883b34 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 27 Feb 2023 09:46:58 -0700 Subject: [PATCH 05/45] Add dotnet CLI tools --- .config/dotnet-tools.json | 18 ++++++++++++++++++ init.ps1 | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 .config/dotnet-tools.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..2599e26 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "powershell": { + "version": "7.3.3", + "commands": [ + "pwsh" + ] + }, + "dotnet-format": { + "version": "5.1.250801", + "commands": [ + "dotnet-format" + ] + } + } +} \ No newline at end of file diff --git a/init.ps1 b/init.ps1 index ad3b414..5bace1e 100755 --- a/init.ps1 +++ b/init.ps1 @@ -91,6 +91,11 @@ try { if ($lastexitcode -ne 0) { throw "Failure while restoring packages." } + + dotnet tool restore @RestoreArguments + if ($lastexitcode -ne 0) { + throw "Failure while restoring dotnet CLI tools." + } } & "$PSScriptRoot/tools/Set-EnvVars.ps1" -Variables $EnvVars -PrependPath $PrependPath | Out-Null From 3eb1436057301cf295b4a895fa2e2d5fe87339c1 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 10 Mar 2023 08:32:03 -0700 Subject: [PATCH 06/45] Bump MicroBuildVersion to 2.0.115 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index a3769e3..62d2ccc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.113 + 2.0.115 From 5132c2206f248cc3ff0e65c0a087a74b6d734d77 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sat, 11 Mar 2023 16:30:55 -0700 Subject: [PATCH 07/45] Add ASP.NET Core runtime installation support --- tools/Install-DotNetSdk.ps1 | 59 ++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 39e47eb..6bff5c2 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -19,13 +19,16 @@ Skips installing the runtime. .PARAMETER IncludeX86 Installs a x86 SDK and runtimes in addition to the x64 ones. Only supported on Windows. Ignored on others. +.PARAMETER IncludeAspNetCore + Installs the ASP.NET Core runtime along with the .NET runtime. #> [CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='Medium')] Param ( [ValidateSet('repo','user','machine')] [string]$InstallLocality='user', [switch]$SdkOnly, - [switch]$IncludeX86 + [switch]$IncludeX86, + [switch]$IncludeAspNetCore ) $DotNetInstallScriptRoot = "$PSScriptRoot/../obj/tools" @@ -49,6 +52,7 @@ if (!$arch) { # Windows Powershell leaves this blank # Search for all .NET runtime versions referenced from MSBuild projects and arrange to install them. $runtimeVersions = @() $windowsDesktopRuntimeVersions = @() +$aspnetRuntimeVersions = @() if (!$SdkOnly) { Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% { $projXml = [xml](Get-Content -Path $_) @@ -65,6 +69,7 @@ if (!$SdkOnly) { $targetFrameworks |? { $_ -match 'net(?:coreapp)?(\d+\.\d+)' } |% { $v = $Matches[1] $runtimeVersions += $v + $aspnetRuntimeVersions += $v if ($v -ge '3.0' -and -not ($IsMacOS -or $IsLinux)) { $windowsDesktopRuntimeVersions += $v } @@ -74,6 +79,7 @@ if (!$SdkOnly) { $targetFrameworks |? { $_ -match 'net(\d+\.\d+)' } |% { $v = $Matches[1] $runtimeVersions += $v + $aspnetRuntimeVersions += $v if (-not ($IsMacOS -or $IsLinux)) { $windowsDesktopRuntimeVersions += $v } @@ -81,6 +87,10 @@ if (!$SdkOnly) { } } +if (!$IncludeAspNetCore) { + $aspnetRuntimeVersions = @() +} + Function Get-FileFromWeb([Uri]$Uri, $OutDir) { $OutFile = Join-Path $OutDir $Uri.Segments[-1] if (!(Test-Path $OutFile)) { @@ -149,7 +159,7 @@ Function Get-InstallerExe( } } -Function Install-DotNet($Version, $Architecture, [ValidateSet('Sdk','Runtime','WindowsDesktop')][string]$sku = 'Sdk') { +Function Install-DotNet($Version, $Architecture, [ValidateSet('Sdk','Runtime','WindowsDesktop','AspNetCore')][string]$sku = 'Sdk') { Write-Host "Downloading .NET $sku $Version..." $Installer = Get-InstallerExe -Version $Version -Architecture $Architecture -sku $sku Write-Host "Installing .NET $sku $Version..." @@ -206,6 +216,17 @@ if ($InstallLocality -eq 'machine') { } } + $aspnetRuntimeVersions | Sort-Object | Get-Unique |% { + if ($PSCmdlet.ShouldProcess("ASP.NET Core $_", "Install")) { + Install-DotNet -Version $_ -sku AspNetCore -Architecture $arch + $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010) + + if ($IncludeX86) { + Install-DotNet -Version $_ -sku AspNetCore -Architecture x86 + $restartRequired = $restartRequired -or ($LASTEXITCODE -eq 3010) + } + } + } if ($restartRequired) { Write-Host -ForegroundColor Yellow "System restart required" Exit 3010 @@ -244,10 +265,10 @@ if ($IncludeX86) { } if ($IsMacOS -or $IsLinux) { - $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/88bd34f089b8a023e3523f22c92abd0ab88e4409/src/dotnet-install.sh" + $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/0b09de9bc136cacb5f849a6957ebd4062173c148/src/dotnet-install.sh" $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.sh" } else { - $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/88bd34f089b8a023e3523f22c92abd0ab88e4409/src/dotnet-install.ps1" + $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/0b09de9bc136cacb5f849a6957ebd4062173c148/src/dotnet-install.ps1" $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.ps1" } @@ -352,6 +373,36 @@ $windowsDesktopRuntimeVersions | Sort-Object -Unique |% { } } +$aspnetRuntimeSwitches = $switches + '-Runtime','aspnetcore' + +$aspnetRuntimeVersions | Sort-Object -Unique |% { + if ($PSCmdlet.ShouldProcess(".NET ASP.NET Core $arch runtime $_", "Install")) { + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $aspnetRuntimeSwitches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } + } else { + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture $arch -InstallDir $DotNetInstallDir $aspnetRuntimeSwitches -DryRun" + } + + if ($IncludeX86) { + if ($PSCmdlet.ShouldProcess(".NET ASP.NET Core x86 runtime $_", "Install")) { + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $aspnetRuntimeSwitches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } + } else { + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ -Architecture x86 -InstallDir $DotNetX86InstallDir $aspnetRuntimeSwitches -DryRun" + } + } +} + if ($PSCmdlet.ShouldProcess("Set DOTNET environment variables to discover these installed runtimes?")) { & "$PSScriptRoot/Set-EnvVars.ps1" -Variables $envVars -PrependPath $DotNetInstallDir | Out-Null } From a921f8dcaf0ba4f93dfec660f503d17ce19d58ea Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sat, 11 Mar 2023 16:40:50 -0700 Subject: [PATCH 08/45] Drop Microsoft.CodeCoverage reference It's brought in via Microsoft.NET.Test.Sdk anyway. --- Directory.Packages.props | 1 - test/Library.Tests/Library.Tests.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b792f3f..b523e5c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,6 @@ true - diff --git a/test/Library.Tests/Library.Tests.csproj b/test/Library.Tests/Library.Tests.csproj index d557e4c..3a6cc04 100644 --- a/test/Library.Tests/Library.Tests.csproj +++ b/test/Library.Tests/Library.Tests.csproj @@ -10,7 +10,6 @@ - From ea48c8eaa182f224ca3ed1a38f2a8034d15dacce Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 13 Mar 2023 15:27:56 -0600 Subject: [PATCH 09/45] Updated SDK installer script to be able to find 7.0.200 --- tools/Install-DotNetSdk.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 6bff5c2..10af504 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -137,6 +137,14 @@ Function Get-InstallerExe( if ($release.$sku.version -eq $Version) { $filesElement = $release.$sku.files } + if (!$filesElement -and ($sku -eq 'sdk') -and $release.sdks) { + foreach ($sdk in $release.sdks) { + if ($sdk.version -eq $Version) { + $filesElement = $sdk.files + break + } + } + } if ($filesElement) { foreach ($file in $filesElement) { @@ -155,7 +163,7 @@ Function Get-InstallerExe( if ($url) { Get-FileFromWeb -Uri $url -OutDir $DotNetInstallScriptRoot } else { - Write-Error "Unable to find release of $sku v$Version" + throw "Unable to find release of $sku v$Version" } } From 2987b4457b0242e91913e9d9f4b43b5db079fd50 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 13 Mar 2023 15:31:46 -0600 Subject: [PATCH 10/45] Bump SDK version to 7.0.201 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index cc08211..cf9eefa 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.101", + "version": "7.0.201", "rollForward": "patch", "allowPrerelease": false } From b47983de022de491725e8e9d4a27bb90166b9947 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 16 Mar 2023 08:28:44 -0600 Subject: [PATCH 11/45] Update MicroBuild signing plugin version --- azure-pipelines/microbuild.before.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/microbuild.before.yml b/azure-pipelines/microbuild.before.yml index d048af4..c933df2 100644 --- a/azure-pipelines/microbuild.before.yml +++ b/azure-pipelines/microbuild.before.yml @@ -9,7 +9,7 @@ steps: outputformat: text condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) -- task: MicroBuildSigningPlugin@3 +- task: MicroBuildSigningPlugin@4 inputs: signType: $(SignType) zipSources: false From 99df8185b1a6aa6abb1cc98aa7f4c0245f8d9012 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 28 Mar 2023 15:53:46 -0600 Subject: [PATCH 12/45] Move `dotnet-coverage` to repo-level tool --- .config/dotnet-tools.json | 8 ++++- azure-pipelines/Merge-CodeCoverage.ps1 | 46 +++++++++++++------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2599e26..610b59c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -13,6 +13,12 @@ "commands": [ "dotnet-format" ] + }, + "dotnet-coverage": { + "version": "17.6.11", + "commands": [ + "dotnet-coverage" + ] } } -} \ No newline at end of file +} diff --git a/azure-pipelines/Merge-CodeCoverage.ps1 b/azure-pipelines/Merge-CodeCoverage.ps1 index 02ff12b..5ecabbc 100644 --- a/azure-pipelines/Merge-CodeCoverage.ps1 +++ b/azure-pipelines/Merge-CodeCoverage.ps1 @@ -20,32 +20,32 @@ Param( ) $RepoRoot = [string](Resolve-Path $PSScriptRoot/..) +Push-Location $RepoRoot +try { + Write-Verbose "Searching $Path for *.cobertura.xml files" + $reports = Get-ChildItem -Recurse $Path -Filter *.cobertura.xml -if (!(Test-Path $RepoRoot/obj/dotnet-coverage*)) { - dotnet tool install --tool-path $RepoRoot/obj dotnet-coverage --version 17.4.3 --configfile $PSScriptRoot/justnugetorg.nuget.config -} + if ($reports) { + $reports |% { $_.FullName } |% { + # In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not. + $xml = [xml](Get-Content -Path $_) + $xml.coverage.packages.package.classes.class |? { $_.filename} |% { + $_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar) + } -Write-Verbose "Searching $Path for *.cobertura.xml files" -$reports = Get-ChildItem -Recurse $Path -Filter *.cobertura.xml - -if ($reports) { - $reports |% { $_.FullName } |% { - # In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not. - $xml = [xml](Get-Content -Path $_) - $xml.coverage.packages.package.classes.class |? { $_.filename} |% { - $_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar) + $xml.Save($_) } - $xml.Save($_) + $Inputs = $reports |% { Resolve-Path -relative $_.FullName } + + if ((Split-Path $OutputFile) -and -not (Test-Path (Split-Path $OutputFile))) { + New-Item -Type Directory -Path (Split-Path $OutputFile) | Out-Null + } + + & dotnet tool run dotnet-coverage merge $Inputs -o $OutputFile -f cobertura + } else { + Write-Error "No reports found to merge." } - - $Inputs = $reports |% { Resolve-Path -relative $_.FullName } - - if ((Split-Path $OutputFile) -and -not (Test-Path (Split-Path $OutputFile))) { - New-Item -Type Directory -Path (Split-Path $OutputFile) | Out-Null - } - - & "$RepoRoot/obj/dotnet-coverage" merge $Inputs -o $OutputFile -f cobertura -} else { - Write-Error "No reports found to merge." +} finally { + Pop-Location } From 14699417fbde409397e7efec56c1b33268ed3634 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 28 Mar 2023 15:58:33 -0600 Subject: [PATCH 13/45] Move `nbgv` into dotnet-tools.json --- .config/dotnet-tools.json | 6 ++++++ azure-pipelines/Get-nbgv.ps1 | 24 ------------------------ azure-pipelines/build.yml | 2 +- 3 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 azure-pipelines/Get-nbgv.ps1 diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 610b59c..5d3dae8 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -19,6 +19,12 @@ "commands": [ "dotnet-coverage" ] + }, + "nbgv": { + "version": "3.5.119", + "commands": [ + "nbgv" + ] } } } diff --git a/azure-pipelines/Get-nbgv.ps1 b/azure-pipelines/Get-nbgv.ps1 deleted file mode 100644 index a5be2cf..0000000 --- a/azure-pipelines/Get-nbgv.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -<# -.SYNOPSIS - Gets the path to the nbgv CLI tool, installing it if necessary. -#> -Param( -) - -$existingTool = Get-Command "nbgv" -ErrorAction SilentlyContinue -if ($existingTool) { - return $existingTool.Path -} - -$toolInstallDir = & "$PSScriptRoot/Get-TempToolsPath.ps1" - -$toolPath = "$toolInstallDir/nbgv" -if (!(Test-Path $toolInstallDir)) { New-Item -Path $toolInstallDir -ItemType Directory | Out-Null } - -if (!(Get-Command $toolPath -ErrorAction SilentlyContinue)) { - Write-Host "Installing nbgv to $toolInstallDir" - dotnet tool install --tool-path "$toolInstallDir" nbgv --configfile "$PSScriptRoot/justnugetorg.nuget.config" | Out-Null -} - -# Normalize the path on the way out. -return (Get-Command $toolPath).Path diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index c868785..2e2f426 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -17,7 +17,7 @@ jobs: clean: true - template: install-dependencies.yml - - powershell: '& (./azure-pipelines/Get-nbgv.ps1) cloud -c' + - script: dotnet tool run nbgv cloud -c displayName: โš™ Set build number - template: dotnet.yml From 3f1e85823fac9136c058aaf48f4b8febed1d0843 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 28 Mar 2023 16:34:38 -0600 Subject: [PATCH 14/45] Install tools except when `-NoToolRestore` is specified --- init.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/init.ps1 b/init.ps1 index 5bace1e..6211304 100755 --- a/init.ps1 +++ b/init.ps1 @@ -28,6 +28,8 @@ No effect if -NoPrerequisites is specified. .PARAMETER NoRestore Skips the package restore step. +.PARAMETER NoToolRestore + Skips the dotnet tool restore step. .PARAMETER AccessToken An optional access token for authenticating to Azure Artifacts authenticated feeds. .PARAMETER Interactive @@ -46,6 +48,8 @@ Param ( [Parameter()] [switch]$NoRestore, [Parameter()] + [switch]$NoToolRestore, + [Parameter()] [string]$AccessToken, [Parameter()] [switch]$Interactive @@ -91,11 +95,13 @@ try { if ($lastexitcode -ne 0) { throw "Failure while restoring packages." } + } - dotnet tool restore @RestoreArguments - if ($lastexitcode -ne 0) { - throw "Failure while restoring dotnet CLI tools." - } + if (!$NoToolRestore -and $PSCmdlet.ShouldProcess("dotnet tool", "restore")) { + dotnet tool restore @RestoreArguments + if ($lastexitcode -ne 0) { + throw "Failure while restoring dotnet CLI tools." + } } & "$PSScriptRoot/tools/Set-EnvVars.ps1" -Variables $EnvVars -PrependPath $PrependPath | Out-Null From 8ba38742fdc439b8ff55cac69b1e2e0ccd8f0cf5 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 3 Apr 2023 13:41:57 -0600 Subject: [PATCH 15/45] Remove Get-NBGV.ps1 references --- azure-pipelines/Archive-SourceCode.ps1 | 2 +- azure-pipelines/archive-sourcecode.yml | 2 ++ azure-pipelines/variables/InsertVersionsValues.ps1 | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/Archive-SourceCode.ps1 b/azure-pipelines/Archive-SourceCode.ps1 index cfc30d2..0fec3e9 100644 --- a/azure-pipelines/Archive-SourceCode.ps1 +++ b/azure-pipelines/Archive-SourceCode.ps1 @@ -155,7 +155,7 @@ if (!$RepoUrl) { } Push-Location $PSScriptRoot -$versionsObj = & (& "$PSScriptRoot/Get-nbgv.ps1") get-version -f json | ConvertFrom-Json +$versionsObj = dotnet tool run nbgv get-version -f json | ConvertFrom-Json Pop-Location $ReleaseDateString = $ReleaseDate.ToShortDateString() diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml index 0c99a23..33705a9 100644 --- a/azure-pipelines/archive-sourcecode.yml +++ b/azure-pipelines/archive-sourcecode.yml @@ -34,6 +34,8 @@ steps: fetchDepth: 0 - powershell: tools/Install-DotNetSdk.ps1 displayName: โš™ Install .NET SDK +- script: dotnet tool restore + displayName: Restore CLI tools - powershell: azure-pipelines/variables/_pipelines.ps1 failOnStderr: true displayName: โš™ Set pipeline variables based on source diff --git a/azure-pipelines/variables/InsertVersionsValues.ps1 b/azure-pipelines/variables/InsertVersionsValues.ps1 index 515e057..c3a0355 100644 --- a/azure-pipelines/variables/InsertVersionsValues.ps1 +++ b/azure-pipelines/variables/InsertVersionsValues.ps1 @@ -4,7 +4,6 @@ # your libraries as defined in the src\ProductData\AssemblyVersions.tt file. return -$nbgv = & "$PSScriptRoot\..\Get-nbgv.ps1" [string]::join(',',(@{ - ('LibraryNoDotsVersion') = & { (& $nbgv get-version --project "$PSScriptRoot\..\..\src\LibraryName" --format json | ConvertFrom-Json).AssemblyVersion }; + ('LibraryNoDotsVersion') = & { (dotnet tool run nbgv get-version --project "$PSScriptRoot\..\..\src\LibraryName" --format json | ConvertFrom-Json).AssemblyVersion }; }.GetEnumerator() |% { "$($_.key)=$($_.value)" })) From 2381c7276720eb8084c1006baf16e6ac6aae2c9a Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 14 Apr 2023 20:54:34 -0600 Subject: [PATCH 16/45] Fix ARM64 detection on Windows Powershell --- tools/Install-DotNetSdk.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 10af504..e190fcf 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -47,6 +47,7 @@ $arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture if (!$arch) { # Windows Powershell leaves this blank $arch = 'x64' if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { $arch = 'ARM64' } + if (${env:ProgramFiles(Arm)}) { $arch = 'ARM64' } } # Search for all .NET runtime versions referenced from MSBuild projects and arrange to install them. From b3e9f4ee3722b395ea4e3cdae74e812b9884d8aa Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 16 Apr 2023 07:29:40 -0600 Subject: [PATCH 17/45] Bump up SDK and tools versions --- .config/dotnet-tools.json | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5d3dae8..151689b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "powershell": { - "version": "7.3.3", + "version": "7.3.4", "commands": [ "pwsh" ] @@ -15,7 +15,7 @@ ] }, "dotnet-coverage": { - "version": "17.6.11", + "version": "17.7.0", "commands": [ "dotnet-coverage" ] diff --git a/global.json b/global.json index cf9eefa..c7d7e46 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.201", + "version": "7.0.203", "rollForward": "patch", "allowPrerelease": false } From 05b6c17376c6da127a9b887b2d9a6263717098c1 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 17 Apr 2023 12:13:34 -0600 Subject: [PATCH 18/45] Skip symbol archival and checks for val-builds --- azure-pipelines/prepare-insertion-stages.yml | 58 +++++++++++--------- azure-pipelines/vs-validation.yml | 4 +- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index bb955d6..ed6b19c 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -1,30 +1,36 @@ +parameters: +- name: ArchiveSymbols + type: boolean + default: true + stages: -- stage: symbol_archive - displayName: Symbol archival - condition: and(succeeded(), eq(dependencies.Build.outputs['Windows.SetPipelineVariables.SignType'], 'Real')) - jobs: - - job: archive - pool: VSEng-ReleasePool-1ES - steps: - - checkout: none - - download: current - artifact: Variables-Windows - displayName: ๐Ÿ”ป Download Variables-Windows artifact - - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 - displayName: โš™๏ธ Set pipeline variables based on artifacts - - download: current - artifact: symbols-legacy - displayName: ๐Ÿ”ป Download symbols-legacy artifact - - task: MicroBuildArchiveSymbols@1 - displayName: ๐Ÿ”ฃ Archive symbols to Symweb - inputs: - SymbolsFeatureName: $(SymbolsFeatureName) - SymbolsSymwebProject: VS - SymbolsUncPath: \\cpvsbuild\drops\$(TeamName)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildId)\Symbols.Archival - SymbolsEmailContacts: vsidemicrobuild - SymbolsAgentPath: $(Pipeline.Workspace)/symbols-legacy - - task: MicroBuildCleanup@1 - displayName: โ˜Ž๏ธ Send Telemetry +- ${{ if parameters.ArchiveSymbols }}: + - stage: symbol_archive + displayName: Symbol archival + condition: and(succeeded(), eq(dependencies.Build.outputs['Windows.SetPipelineVariables.SignType'], 'Real')) + jobs: + - job: archive + pool: VSEng-ReleasePool-1ES + steps: + - checkout: none + - download: current + artifact: Variables-Windows + displayName: ๐Ÿ”ป Download Variables-Windows artifact + - powershell: $(Pipeline.Workspace)/Variables-Windows/_pipelines.ps1 + displayName: โš™๏ธ Set pipeline variables based on artifacts + - download: current + artifact: symbols-legacy + displayName: ๐Ÿ”ป Download symbols-legacy artifact + - task: MicroBuildArchiveSymbols@1 + displayName: ๐Ÿ”ฃ Archive symbols to Symweb + inputs: + SymbolsFeatureName: $(SymbolsFeatureName) + SymbolsSymwebProject: VS + SymbolsUncPath: \\cpvsbuild\drops\$(TeamName)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildId)\Symbols.Archival + SymbolsEmailContacts: vsidemicrobuild + SymbolsAgentPath: $(Pipeline.Workspace)/symbols-legacy + - task: MicroBuildCleanup@1 + displayName: โ˜Ž๏ธ Send Telemetry # - stage: azure_public_vsimpl_feed # displayName: azure-public/vs-impl feed diff --git a/azure-pipelines/vs-validation.yml b/azure-pipelines/vs-validation.yml index 82a82aa..d32634c 100644 --- a/azure-pipelines/vs-validation.yml +++ b/azure-pipelines/vs-validation.yml @@ -24,6 +24,8 @@ stages: RunTests: false - template: prepare-insertion-stages.yml + parameters: + ArchiveSymbols: false - stage: insertion displayName: VS insertion @@ -60,7 +62,7 @@ stages: inputs: TeamName: $(TeamName) TeamEmail: $(TeamEmail) - InsertionPayloadName: $(Build.Repository.Name) VALIDATION BUILD $(Build.BuildNumber) ($(Build.SourceBranch)) + InsertionPayloadName: $(Build.Repository.Name) VALIDATION BUILD $(Build.BuildNumber) ($(Build.SourceBranch)) [Skip-SymbolCheck] InsertionDescription: | This PR is for **validation purposes only** for !$(System.PullRequest.PullRequestId). **Do not complete**. CustomScriptExecutionCommand: src/VSSDK/NuGet/AllowUnstablePackages.ps1 From 0c36c87330bb89a4b39d69703263dc14f10831ab Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 17 Apr 2023 12:13:59 -0600 Subject: [PATCH 19/45] Copy the .config file when applying the template --- Apply-Template.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Apply-Template.ps1 b/Apply-Template.ps1 index 12bfaa1..1c77335 100644 --- a/Apply-Template.ps1 +++ b/Apply-Template.ps1 @@ -31,6 +31,7 @@ try { Write-Host "Updating $Path" robocopy /mir $PSScriptRoot/azure-pipelines $Path/azure-pipelines +robocopy /mir $PSScriptRoot/.config $Path/.config robocopy /mir $PSScriptRoot/.devcontainer $Path/.devcontainer robocopy /mir $PSScriptRoot/.github $Path/.github robocopy /mir $PSScriptRoot/.vscode $Path/.vscode From 591d64ee9e9fbe3311308d3c57cdb80f66353086 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 25 Apr 2023 09:50:33 -0600 Subject: [PATCH 20/45] Upgrade `actions/checkout` GitHub action to v3 This resolves a warning about old node.js version based github actions. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7718f84..3fc278d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: - windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - name: โš™ Install prerequisites From 30cf33841a0e98dd1901643cb3a5dce277c30a99 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 25 Apr 2023 10:14:19 -0600 Subject: [PATCH 21/45] Fix source archival pipeline nuget auth failures --- azure-pipelines/archive-sourcecode.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml index 33705a9..d9e7944 100644 --- a/azure-pipelines/archive-sourcecode.yml +++ b/azure-pipelines/archive-sourcecode.yml @@ -34,6 +34,10 @@ steps: fetchDepth: 0 - powershell: tools/Install-DotNetSdk.ps1 displayName: โš™ Install .NET SDK +- task: NuGetAuthenticate@1 + displayName: ๐Ÿ” Authenticate NuGet feeds + inputs: + forceReinstallCredentialProvider: true - script: dotnet tool restore displayName: Restore CLI tools - powershell: azure-pipelines/variables/_pipelines.ps1 From 1afa3e42190709e07ef276b076897335e0c87451 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 26 Apr 2023 10:28:56 -0600 Subject: [PATCH 22/45] Fix and simplify BinSkim --- azure-pipelines/archive-sourcecode.yml | 2 +- azure-pipelines/secure-development-tools.yml | 21 +++++++++++--------- azure-pipelines/variables/BinSkimTargets.ps1 | 4 ---- 3 files changed, 13 insertions(+), 14 deletions(-) delete mode 100644 azure-pipelines/variables/BinSkimTargets.ps1 diff --git a/azure-pipelines/archive-sourcecode.yml b/azure-pipelines/archive-sourcecode.yml index d9e7944..db270eb 100644 --- a/azure-pipelines/archive-sourcecode.yml +++ b/azure-pipelines/archive-sourcecode.yml @@ -39,7 +39,7 @@ steps: inputs: forceReinstallCredentialProvider: true - script: dotnet tool restore - displayName: Restore CLI tools + displayName: โš™๏ธ Restore CLI tools - powershell: azure-pipelines/variables/_pipelines.ps1 failOnStderr: true displayName: โš™ Set pipeline variables based on source diff --git a/azure-pipelines/secure-development-tools.yml b/azure-pipelines/secure-development-tools.yml index ac540ae..0ca483d 100644 --- a/azure-pipelines/secure-development-tools.yml +++ b/azure-pipelines/secure-development-tools.yml @@ -16,25 +16,28 @@ steps: targetArgument: $(System.DefaultWorkingDirectory) optionsUEPATH: $(System.DefaultWorkingDirectory)\azure-pipelines\PoliCheckExclusions.xml -- task: BinSkim@4 - displayName: ๐Ÿ” Run BinSkim - inputs: - InputType: Basic - Function: analyze - TargetPattern: guardianGlob - AnalyzeTargetGlob: $(BinSkimTargets) - - task: CopyFiles@2 - displayName: ๐Ÿ” Collect APIScan inputs + displayName: ๐Ÿ“‚ Collect APIScan/BinSkim inputs inputs: SourceFolder: $(Build.ArtifactStagingDirectory)/Symbols-$(Agent.JobName) # Exclude any patterns from the Contents (e.g. `!**/git2*`) that we have symbols for but do not need to run APIScan on. Contents: | ** !**/arm64/** + !**/win-arm64/** + !**/linux-*/** + !**/osx*/** TargetFolder: $(Build.ArtifactStagingDirectory)/APIScanInputs condition: and(succeeded(), ${{ parameters.EnableAPIScan }}, ne(variables.ApiScanClientId, '')) +- task: BinSkim@4 + displayName: ๐Ÿ” Run BinSkim + inputs: + InputType: Basic + Function: analyze + TargetPattern: guardianGlob + AnalyzeTargetGlob: $(Build.ArtifactStagingDirectory)/APIScanInputs/**/*.dll;$(Build.ArtifactStagingDirectory)/APIScanInputs/**/*.exe + - task: APIScan@2 displayName: ๐Ÿ” Run APIScan inputs: diff --git a/azure-pipelines/variables/BinSkimTargets.ps1 b/azure-pipelines/variables/BinSkimTargets.ps1 deleted file mode 100644 index 723b28c..0000000 --- a/azure-pipelines/variables/BinSkimTargets.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -$Path = "$PSScriptRoot\..\..\bin" -if (Test-Path $Path) { - [string]::join(';', (& "$PSScriptRoot\..\Get-SymbolFiles.ps1" -Path $Path)) -} From e45848775d23805e530d9e0475307afc936a6d24 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sat, 29 Apr 2023 12:04:57 -0600 Subject: [PATCH 23/45] Elevate CA1062 for shipping code --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 0786877..fce73c0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -176,5 +176,8 @@ dotnet_diagnostic.DOC108.severity = warning dotnet_diagnostic.DOC200.severity = warning dotnet_diagnostic.DOC202.severity = warning +# CA1062: Validate arguments of public methods +dotnet_diagnostic.CA1062.severity = warning + [*.sln] indent_style = tab From c3c23f7e91194f845d8df92755edb6803f6cea47 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 1 May 2023 08:10:45 -0600 Subject: [PATCH 24/45] Bump Nerdbank.GitVersioning to 3.6.128 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 151689b..54fc588 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nbgv": { - "version": "3.5.119", + "version": "3.6.128", "commands": [ "nbgv" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index b523e5c..5758824 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,7 +12,7 @@ - + From dfcf3754d53d0a959c97c14fbfd8696177273aaa Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 1 May 2023 09:40:39 -0600 Subject: [PATCH 25/45] Bump MicroBuild version --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index fc9f6c6..8e2703d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.115 + 2.0.117 From e90465acd44c421921f48cca04fc4c7e73dd7034 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 1 May 2023 22:48:46 -0600 Subject: [PATCH 26/45] Update Dockerfile --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7ffd07e..01c94a9 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:7.0.101-jammy +FROM mcr.microsoft.com/dotnet/sdk:7.0.203-jammy # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. From 46b4f565e380906d043528f2442c0cb1591f585c Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 2 May 2023 07:41:53 -0600 Subject: [PATCH 27/45] Fix placement of $RestoreArguments construction --- init.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/init.ps1 b/init.ps1 index 6211304..00a9589 100755 --- a/init.ps1 +++ b/init.ps1 @@ -83,13 +83,13 @@ Push-Location $PSScriptRoot try { $HeaderColor = 'Green' - if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) { - $RestoreArguments = @() - if ($Interactive) - { - $RestoreArguments += '--interactive' - } + $RestoreArguments = @() + if ($Interactive) + { + $RestoreArguments += '--interactive' + } + if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) { Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor dotnet restore @RestoreArguments if ($lastexitcode -ne 0) { From 4d4c330486ea2fe98d9ae70ed1c05fb5bba31c92 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 11 May 2023 08:51:17 -0600 Subject: [PATCH 28/45] Switch from `MSBuildTreatWarningsAsErrors` to `-warnaserror` This is per @rainersigwald's suggestion in https://github.com/dotnet/msbuild/issues/8735#issuecomment-1544076504 --- .github/workflows/build.yml | 3 +-- azure-pipelines.yml | 1 - azure-pipelines/dotnet.yml | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3fc278d..3350282 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,6 @@ on: pull_request: env: - MSBuildTreatWarningsAsErrors: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true BUILDCONFIGURATION: Release # codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/ @@ -44,7 +43,7 @@ jobs: run: azure-pipelines/variables/_pipelines.ps1 shell: pwsh - name: ๐Ÿ›  build - run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} /v:m /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" + run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnaserror /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" - name: ๐Ÿงช test run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} shell: pwsh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 521d4ce..9867b3d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,7 +23,6 @@ parameters: default: true variables: - MSBuildTreatWarningsAsErrors: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true BuildConfiguration: Release codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/ diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 79babd4..5124154 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -3,7 +3,7 @@ parameters: steps: -- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" +- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" displayName: ๐Ÿ›  dotnet build - powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults From c84fe06b9701ea6ac7b6bebed8a6f5f0064c9561 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 17 May 2023 07:04:10 -0600 Subject: [PATCH 29/45] Fix BinSkim when ApiScan won't run --- azure-pipelines/secure-development-tools.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines/secure-development-tools.yml b/azure-pipelines/secure-development-tools.yml index 0ca483d..ce8ac94 100644 --- a/azure-pipelines/secure-development-tools.yml +++ b/azure-pipelines/secure-development-tools.yml @@ -28,7 +28,6 @@ steps: !**/linux-*/** !**/osx*/** TargetFolder: $(Build.ArtifactStagingDirectory)/APIScanInputs - condition: and(succeeded(), ${{ parameters.EnableAPIScan }}, ne(variables.ApiScanClientId, '')) - task: BinSkim@4 displayName: ๐Ÿ” Run BinSkim From aefd199847243c1e0a6a8224db00ccb25a5bc9e0 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 17 May 2023 10:56:28 -0600 Subject: [PATCH 30/45] Bump .NET SDK to 7.0.302 --- .devcontainer/Dockerfile | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 01c94a9..6d2f30d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:7.0.203-jammy +FROM mcr.microsoft.com/dotnet/sdk:7.0.302-jammy # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. diff --git a/global.json b/global.json index c7d7e46..abde95a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.203", + "version": "7.0.302", "rollForward": "patch", "allowPrerelease": false } From 4406d85960e468f19f0868991757aae74fbf7224 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 18 May 2023 06:23:33 -0600 Subject: [PATCH 31/45] Parameterize and add diagnostics to InsertVersionsValues.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's been failing ever since switching from `Get-Nbgv.ps1` to `dotnet tool run nbgv`, but only on Azure Pipelines, and only on certain commits. Quite literally, it fails repeatedly on some particular commit, and if I push a new *empty* commit, it succeeds. This makes me believe that somehow, the git database or git commit id itself or something is causing `nbgv` to fail. I have no idea why it would fail with this output though: ``` Computing InsertVersionsValues variable Option '--project' expects a single argument but 2 were provided. ConvertFrom-Json: /home/vsts/work/1/s/azure-pipelines/variables/InsertVersionsValues.ps1:2 Line | 2 | โ€ฆ oft.VisualStudio.Validation" --format json | ConvertFrom-Json).Assemb โ€ฆ | ~~~~~~~~~~~~~~~~ | Conversion from JSON failed with error: Unexpected character encountered | while parsing value: D. Path '', line 0, position 0. ``` The output suggests a malformed command line, but I simply see no possible way for that to happen. Nor can I repro it locally. --- .../variables/InsertVersionsValues.ps1 | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/variables/InsertVersionsValues.ps1 b/azure-pipelines/variables/InsertVersionsValues.ps1 index c3a0355..9bc7bc8 100644 --- a/azure-pipelines/variables/InsertVersionsValues.ps1 +++ b/azure-pipelines/variables/InsertVersionsValues.ps1 @@ -4,6 +4,30 @@ # your libraries as defined in the src\ProductData\AssemblyVersions.tt file. return -[string]::join(',',(@{ - ('LibraryNoDotsVersion') = & { (dotnet tool run nbgv get-version --project "$PSScriptRoot\..\..\src\LibraryName" --format json | ConvertFrom-Json).AssemblyVersion }; -}.GetEnumerator() |% { "$($_.key)=$($_.value)" })) +$MacroName = 'LibraryNoDotsVersion' +$SampleProject = "$PSScriptRoot\..\..\src\LibraryName" +try { + return [string]::join(',',(@{ + ($MacroName) = & { (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion }; + }.GetEnumerator() |% { "$($_.key)=$($_.value)" })) +} +catch { + Write-Error $_ + Write-Error "Failed. Diagnostic data proceeds:" + [string]::join(',',(@{ + ($MacroName) = & { + Write-Host "dotnet tool run nbgv get-version --project `"$SampleProject`" --format json" + $result1 = dotnet tool run nbgv get-version --project $SampleProject --format json + Write-Host $result1 + $result2 = dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json + Write-Host $result2 + Write-Host $result2.AssemblyVersion + Write-Host (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion + Write-Output (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion + }; + }.GetEnumerator() |% { "$($_.key)=$($_.value)" })) + + Write-Host "one more..." + $r = & { (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion }; + Write-Host $r +} From b33fad3f1fab1559e672d4cacb92d763568a9bd3 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 19 May 2023 13:32:53 -0600 Subject: [PATCH 32/45] Fix schedule triggered source code archival --- azure-pipelines/Archive-SourceCode.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/Archive-SourceCode.ps1 b/azure-pipelines/Archive-SourceCode.ps1 index 0fec3e9..9158c9b 100644 --- a/azure-pipelines/Archive-SourceCode.ps1 +++ b/azure-pipelines/Archive-SourceCode.ps1 @@ -135,7 +135,7 @@ if (!$Requester) { $Requester = $env:USERNAME } if (!$Requester) { - Write-Error "Unable to determine default value for -Requester." + $Requester = $OwnerAlias } } From 8f6c4d6ba6875dc382b4ad7ea148c7871e3e7cc4 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 19 May 2023 16:38:05 -0600 Subject: [PATCH 33/45] Upgrade archive symbols task to v4 --- azure-pipelines/prepare-insertion-stages.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index ed6b19c..e194ff4 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -10,7 +10,7 @@ stages: condition: and(succeeded(), eq(dependencies.Build.outputs['Windows.SetPipelineVariables.SignType'], 'Real')) jobs: - job: archive - pool: VSEng-ReleasePool-1ES + pool: VSEngSS-MicroBuild2022-1ES steps: - checkout: none - download: current @@ -21,14 +21,13 @@ stages: - download: current artifact: symbols-legacy displayName: ๐Ÿ”ป Download symbols-legacy artifact - - task: MicroBuildArchiveSymbols@1 + - task: MicroBuildArchiveSymbols@4 displayName: ๐Ÿ”ฃ Archive symbols to Symweb inputs: SymbolsFeatureName: $(SymbolsFeatureName) - SymbolsSymwebProject: VS - SymbolsUncPath: \\cpvsbuild\drops\$(TeamName)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildId)\Symbols.Archival - SymbolsEmailContacts: vsidemicrobuild + SymbolsProject: VS SymbolsAgentPath: $(Pipeline.Workspace)/symbols-legacy + azureSubscription: Symbols Upload (DevDiv) - task: MicroBuildCleanup@1 displayName: โ˜Ž๏ธ Send Telemetry From b46d049fc37c9d0537ddb9b2b8653d2de8c88e14 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 19 May 2023 16:40:50 -0600 Subject: [PATCH 34/45] Consolidate two stages to just one --- azure-pipelines/prepare-insertion-stages.yml | 60 ++++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index e194ff4..bb3a400 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -4,12 +4,13 @@ parameters: default: true stages: -- ${{ if parameters.ArchiveSymbols }}: - - stage: symbol_archive - displayName: Symbol archival - condition: and(succeeded(), eq(dependencies.Build.outputs['Windows.SetPipelineVariables.SignType'], 'Real')) - jobs: - - job: archive +- stage: release + displayName: Publish + condition: and(succeeded(), eq(dependencies.Build.outputs['Windows.SetPipelineVariables.SignType'], 'Real')) + jobs: + - ${{ if parameters.ArchiveSymbols }}: + - job: symbol_archive + displayName: Archive symbols pool: VSEngSS-MicroBuild2022-1ES steps: - checkout: none @@ -31,28 +32,27 @@ stages: - task: MicroBuildCleanup@1 displayName: โ˜Ž๏ธ Send Telemetry -# - stage: azure_public_vsimpl_feed +# - job: push # displayName: azure-public/vs-impl feed -# condition: and(succeeded(), eq(dependencies.Build.outputs['Windows.SetPipelineVariables.SignType'], 'Real')) -# jobs: -# - job: push -# pool: -# name: AzurePipelines-EO -# vmImage: AzurePipelinesUbuntu20.04compliant -# steps: -# - checkout: none -# - download: current -# artifact: deployables-Windows -# displayName: ๐Ÿ”ป Download deployables-Windows artifact -# - task: UseDotNet@2 -# displayName: โš™๏ธ Install .NET SDK -# inputs: -# packageType: sdk -# version: 6.x -# - task: NuGetAuthenticate@1 -# displayName: ๐Ÿ” Authenticate NuGet feeds -# inputs: -# nuGetServiceConnections: azure-public/vs-impl -# forceReinstallCredentialProvider: true -# - script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/NuGet/*.nupkg -s https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json --api-key azdo --skip-duplicate -# displayName: ๐Ÿ“ฆ Push nuget packages +# ${{ if parameters.ArchiveSymbols }}: +# dependsOn: symbol_archive +# pool: +# name: AzurePipelines-EO +# vmImage: AzurePipelinesUbuntu20.04compliant +# steps: +# - checkout: none +# - download: current +# artifact: deployables-Windows +# displayName: ๐Ÿ”ป Download deployables-Windows artifact +# - task: UseDotNet@2 +# displayName: โš™๏ธ Install .NET SDK +# inputs: +# packageType: sdk +# version: 6.x +# - task: NuGetAuthenticate@1 +# displayName: ๐Ÿ” Authenticate NuGet feeds +# inputs: +# nuGetServiceConnections: azure-public/vs-impl +# forceReinstallCredentialProvider: true +# - script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/NuGet/*.nupkg -s https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json --api-key azdo --skip-duplicate +# displayName: ๐Ÿ“ฆ Push nuget packages From 354b522a12ab85fd819356484a63e7cf38ae2579 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sat, 20 May 2023 13:25:55 -0600 Subject: [PATCH 35/45] Bump NB.GV to 3.6.132 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 54fc588..93547fa 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nbgv": { - "version": "3.6.128", + "version": "3.6.132", "commands": [ "nbgv" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 5758824..7cf54cc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,7 +12,7 @@ - + From 4f2a6d8391ae5f2b9a577bd3c3bbb03a201a4ff8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 May 2023 13:28:47 -0600 Subject: [PATCH 36/45] Bump CSharpIsNullAnalyzer from 0.1.329 to 0.1.495 (#204) * Crank up dependabot * Bump CSharpIsNullAnalyzer from 0.1.329 to 0.1.495 Bumps [CSharpIsNullAnalyzer](https://github.com/AArnott/CSharpIsNull) from 0.1.329 to 0.1.495. - [Release notes](https://github.com/AArnott/CSharpIsNull/releases) - [Commits](https://github.com/AArnott/CSharpIsNull/commits) --- updated-dependencies: - dependency-name: CSharpIsNullAnalyzer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Andrew Arnott Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/dependabot.yml | 4 ++-- Directory.Packages.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b9b0f54..63e3e89 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,9 @@ # Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file version: 2 updates: - package-ecosystem: nuget directory: / schedule: - interval: monthly + interval: weekly diff --git a/Directory.Packages.props b/Directory.Packages.props index 7cf54cc..74916ca 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -10,7 +10,7 @@ - + From 119ce0770abc0ad1a3b8bdab3ca622470579ec92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 May 2023 13:29:01 -0600 Subject: [PATCH 37/45] Bump Microsoft.NET.Test.Sdk from 17.5.0 to 17.6.0 (#202) * Crank up dependabot * Bump Microsoft.NET.Test.Sdk from 17.5.0 to 17.6.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.5.0 to 17.6.0. - [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.5.0...v17.6.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: Andrew Arnott Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 74916ca..061f8ed 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true - + From 0991fe932a245d50f30ebab193a3cd50dc520939 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 May 2023 13:29:13 -0600 Subject: [PATCH 38/45] Bump dotnet-coverage from 17.7.0 to 17.7.1 (#205) * Crank up dependabot * Bump dotnet-coverage from 17.7.0 to 17.7.1 Bumps [dotnet-coverage](https://github.com/microsoft/codecoverage) from 17.7.0 to 17.7.1. - [Commits](https://github.com/microsoft/codecoverage/commits) --- updated-dependencies: - dependency-name: dotnet-coverage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Andrew Arnott Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 93547fa..5ed46cc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-coverage": { - "version": "17.7.0", + "version": "17.7.1", "commands": [ "dotnet-coverage" ] From 2e6a2d1c2f93069381266ae7e49a4a4e6bf43b8c Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 22 May 2023 08:31:09 -0600 Subject: [PATCH 39/45] (Hopefully) fix `nbgv` failures with `--` argument separator I believe `dotnet tool run` may be stealing the `--project` parameter non-deterministically (perhaps due to string hashing inputs that change in every process). By adding `--` in front of all parameters for the `nbgv` tool, I believe and hope this will resolve the issue by forcing the command line parser to interpret all subsequent command line arguments to be directed to `nbgv`. --- .../variables/InsertVersionsValues.ps1 | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/azure-pipelines/variables/InsertVersionsValues.ps1 b/azure-pipelines/variables/InsertVersionsValues.ps1 index 9bc7bc8..2eb2fce 100644 --- a/azure-pipelines/variables/InsertVersionsValues.ps1 +++ b/azure-pipelines/variables/InsertVersionsValues.ps1 @@ -6,28 +6,6 @@ return $MacroName = 'LibraryNoDotsVersion' $SampleProject = "$PSScriptRoot\..\..\src\LibraryName" -try { - return [string]::join(',',(@{ - ($MacroName) = & { (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion }; - }.GetEnumerator() |% { "$($_.key)=$($_.value)" })) -} -catch { - Write-Error $_ - Write-Error "Failed. Diagnostic data proceeds:" - [string]::join(',',(@{ - ($MacroName) = & { - Write-Host "dotnet tool run nbgv get-version --project `"$SampleProject`" --format json" - $result1 = dotnet tool run nbgv get-version --project $SampleProject --format json - Write-Host $result1 - $result2 = dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json - Write-Host $result2 - Write-Host $result2.AssemblyVersion - Write-Host (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion - Write-Output (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion - }; - }.GetEnumerator() |% { "$($_.key)=$($_.value)" })) - - Write-Host "one more..." - $r = & { (dotnet tool run nbgv get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion }; - Write-Host $r -} +[string]::join(',',(@{ + ($MacroName) = & { (dotnet tool run nbgv -- get-version --project $SampleProject --format json | ConvertFrom-Json).AssemblyVersion }; +}.GetEnumerator() |% { "$($_.key)=$($_.value)" })) From 6ed5201ef0c74f14f07fa87b3ff1db64187fab2f Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 22 May 2023 08:43:08 -0600 Subject: [PATCH 40/45] Fix indentation of commented section --- azure-pipelines/prepare-insertion-stages.yml | 48 ++++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/azure-pipelines/prepare-insertion-stages.yml b/azure-pipelines/prepare-insertion-stages.yml index bb3a400..a41be03 100644 --- a/azure-pipelines/prepare-insertion-stages.yml +++ b/azure-pipelines/prepare-insertion-stages.yml @@ -32,27 +32,27 @@ stages: - task: MicroBuildCleanup@1 displayName: โ˜Ž๏ธ Send Telemetry -# - job: push -# displayName: azure-public/vs-impl feed -# ${{ if parameters.ArchiveSymbols }}: -# dependsOn: symbol_archive -# pool: -# name: AzurePipelines-EO -# vmImage: AzurePipelinesUbuntu20.04compliant -# steps: -# - checkout: none -# - download: current -# artifact: deployables-Windows -# displayName: ๐Ÿ”ป Download deployables-Windows artifact -# - task: UseDotNet@2 -# displayName: โš™๏ธ Install .NET SDK -# inputs: -# packageType: sdk -# version: 6.x -# - task: NuGetAuthenticate@1 -# displayName: ๐Ÿ” Authenticate NuGet feeds -# inputs: -# nuGetServiceConnections: azure-public/vs-impl -# forceReinstallCredentialProvider: true -# - script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/NuGet/*.nupkg -s https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json --api-key azdo --skip-duplicate -# displayName: ๐Ÿ“ฆ Push nuget packages + # - job: push + # displayName: azure-public/vs-impl feed + # ${{ if parameters.ArchiveSymbols }}: + # dependsOn: symbol_archive + # pool: + # name: AzurePipelines-EO + # vmImage: AzurePipelinesUbuntu20.04compliant + # steps: + # - checkout: none + # - download: current + # artifact: deployables-Windows + # displayName: ๐Ÿ”ป Download deployables-Windows artifact + # - task: UseDotNet@2 + # displayName: โš™๏ธ Install .NET SDK + # inputs: + # packageType: sdk + # version: 6.x + # - task: NuGetAuthenticate@1 + # displayName: ๐Ÿ” Authenticate NuGet feeds + # inputs: + # nuGetServiceConnections: azure-public/vs-impl + # forceReinstallCredentialProvider: true + # - script: dotnet nuget push $(Pipeline.Workspace)/deployables-Windows/NuGet/*.nupkg -s https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json --api-key azdo --skip-duplicate + # displayName: ๐Ÿ“ฆ Push nuget packages From e50278a744ac29ee6f066b9406d2933c898f3eea Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sat, 27 May 2023 07:48:43 -0600 Subject: [PATCH 41/45] Bump Nerdbank.GitVersioning to 3.6.133 --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5ed46cc..fa4ceb5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -21,7 +21,7 @@ ] }, "nbgv": { - "version": "3.6.132", + "version": "3.6.133", "commands": [ "nbgv" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 061f8ed..738a2f9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,7 +12,7 @@ - + From 1579bbaf76e95e700c4aef5311fd5aefc0dd2e18 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 5 Jun 2023 07:21:57 -0600 Subject: [PATCH 42/45] Bump Microsoft.NET.Test.Sdk to 17.6.1 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 738a2f9..386c6ee 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true - + From 0ba0030cbccba29085cb85cfec8702596645a62b Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 7 Jun 2023 14:30:51 -0600 Subject: [PATCH 43/45] Enable dependabot for Azure Repos --- .azuredevops/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .azuredevops/dependabot.yml diff --git a/.azuredevops/dependabot.yml b/.azuredevops/dependabot.yml new file mode 100644 index 0000000..4d848fb --- /dev/null +++ b/.azuredevops/dependabot.yml @@ -0,0 +1,9 @@ +# Please see the documentation for all configuration options: +# https://eng.ms/docs/products/dependabot/configuration/version_updates + +version: 2 +updates: +- package-ecosystem: nuget + directory: / + schedule: + interval: monthly From e22efe97b08fa4795d834d7e16310143195345d6 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 7 Jun 2023 15:52:58 -0600 Subject: [PATCH 44/45] Bump Microsoft.NET.Test.Sdk to 17.6.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 386c6ee..1de3328 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ true - + From b077dd9451c6676f9a9a0ad9cda0bee636e49c67 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 12 Jun 2023 08:31:07 -0600 Subject: [PATCH 45/45] Bump MicroBuild to 2.0.125 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2fe653e..7c07eff 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.117 + 2.0.125