Skip to content

Commit 0dae7ae

Browse files
[main] Update dependencies from dotnet/arcade (#7052)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
1 parent aaa16e9 commit 0dae7ae

File tree

8 files changed

+56
-141
lines changed

8 files changed

+56
-141
lines changed

eng/Version.Details.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
33
<ToolsetDependencies>
4-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.25603.2">
4+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="11.0.0-beta.25604.3">
55
<Uri>https://github.com/dotnet/arcade</Uri>
6-
<Sha>9851192f7f7a7ee352358cce2627160fd1f2a54e</Sha>
6+
<Sha>fa753b76d445da82f9b46d6d12ba382ab6fed81f</Sha>
77
</Dependency>
8-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="11.0.0-beta.25603.2">
8+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="11.0.0-beta.25604.3">
99
<Uri>https://github.com/dotnet/arcade</Uri>
10-
<Sha>9851192f7f7a7ee352358cce2627160fd1f2a54e</Sha>
10+
<Sha>fa753b76d445da82f9b46d6d12ba382ab6fed81f</Sha>
1111
</Dependency>
12-
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="11.0.0-beta.25603.2">
12+
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="11.0.0-beta.25604.3">
1313
<Uri>https://github.com/dotnet/arcade</Uri>
14-
<Sha>9851192f7f7a7ee352358cce2627160fd1f2a54e</Sha>
14+
<Sha>fa753b76d445da82f9b46d6d12ba382ab6fed81f</Sha>
1515
</Dependency>
1616
<Dependency Name="Microsoft.Testing.Extensions.CodeCoverage" Version="18.3.0-preview.25603.1">
1717
<Uri>https://dev.azure.com/devdiv/DevDiv/_git/vs-code-coverage</Uri>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
88
</PropertyGroup>
99
<PropertyGroup Label="MSTest prod dependencies - darc updated">
10-
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>11.0.0-beta.25603.2</MicrosoftDotNetBuildTasksTemplatingPackageVersion>
10+
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>11.0.0-beta.25604.3</MicrosoftDotNetBuildTasksTemplatingPackageVersion>
1111
<MicrosoftTestingExtensionsCodeCoverageVersion>18.3.0-preview.25603.1</MicrosoftTestingExtensionsCodeCoverageVersion>
1212
<!-- empty line to avoid merge conflicts for darc PRs to update CC and MSTest+MTP -->
1313
<MSTestVersion>4.1.0-preview.25603.1</MSTestVersion>

eng/common/core-templates/post-build/post-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ stages:
154154
- task: PowerShell@2
155155
displayName: Validate
156156
inputs:
157-
filePath: $(System.DefaultWorkingDirectory)/eng/common/post-build/nuget-validation.ps1
157+
filePath: $(System.DefaultWorkingDirectory)/eng/common/post-build/nuget-verification.ps1
158158
arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/
159159

160160
- job:

eng/common/post-build/nuget-validation.ps1

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 47 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,66 @@
11
<#
22
.SYNOPSIS
3-
Verifies that Microsoft NuGet packages have proper metadata.
3+
Verifies NuGet packages using dotnet nuget verify.
44
.DESCRIPTION
5-
Downloads a verification tool and runs metadata validation on the provided NuGet packages. This script writes an
6-
error if any of the provided packages fail validation. All arguments provided to this PowerShell script that do not
7-
match PowerShell parameters are passed on to the verification tool downloaded during the execution of this script.
8-
.PARAMETER NuGetExePath
9-
The path to the nuget.exe binary to use. If not provided, nuget.exe will be downloaded into the -DownloadPath
10-
directory.
11-
.PARAMETER PackageSource
12-
The package source to use to download the verification tool. If not provided, nuget.org will be used.
13-
.PARAMETER DownloadPath
14-
The directory path to download the verification tool and nuget.exe to. If not provided,
15-
%TEMP%\NuGet.VerifyNuGetPackage will be used.
16-
.PARAMETER args
17-
Arguments that will be passed to the verification tool.
5+
Initializes the .NET CLI and runs 'dotnet nuget verify' on the provided NuGet packages.
6+
This script writes an error if any of the provided packages fail verification.
7+
.PARAMETER PackagesPath
8+
Path to the directory containing NuGet packages to verify.
189
.EXAMPLE
19-
PS> .\verify.ps1 *.nupkg
20-
Verifies the metadata of all .nupkg files in the currect working directory.
21-
.EXAMPLE
22-
PS> .\verify.ps1 --help
23-
Displays the help text of the downloaded verifiction tool.
24-
.LINK
25-
https://github.com/NuGet/NuGetGallery/blob/master/src/VerifyMicrosoftPackage/README.md
10+
PS> .\nuget-verification.ps1 -PackagesPath C:\packages
11+
Verifies all .nupkg files in the specified directory.
2612
#>
2713

28-
# This script was copied from https://github.com/NuGet/NuGetGallery/blob/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1
29-
30-
[CmdletBinding(PositionalBinding = $false)]
3114
param(
32-
[string]$NuGetExePath,
33-
[string]$PackageSource = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json",
34-
[string]$DownloadPath,
35-
[Parameter(ValueFromRemainingArguments = $true)]
36-
[string[]]$args
15+
[Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are
3716
)
3817

39-
# The URL to download nuget.exe.
40-
$nugetExeUrl = "https://dist.nuget.org/win-x86-commandline/v4.9.4/nuget.exe"
18+
# `tools.ps1` checks $ci to perform some actions. Since the post-build
19+
# scripts don't necessarily execute in the same agent that run the
20+
# build.ps1/sh script this variable isn't automatically set.
21+
$ci = $true
22+
$disableConfigureToolsetImport = $true
23+
. $PSScriptRoot\..\tools.ps1
4124

42-
# The package ID of the verification tool.
43-
$packageId = "NuGet.VerifyMicrosoftPackage"
25+
try {
26+
$fence = New-Object -TypeName string -ArgumentList '=', 80
4427

45-
# The location that nuget.exe and the verification tool will be downloaded to.
46-
if (!$DownloadPath) {
47-
$DownloadPath = (Join-Path $env:TEMP "NuGet.VerifyMicrosoftPackage")
48-
}
28+
# Initialize the dotnet CLI
29+
$dotnetRoot = InitializeDotNetCli -install:$true
30+
$dotnet = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet')
4931

50-
$fence = New-Object -TypeName string -ArgumentList '=', 80
32+
Write-Host "Using dotnet: $dotnet"
33+
Write-Host " "
5134

52-
# Create the download directory, if it doesn't already exist.
53-
if (!(Test-Path $DownloadPath)) {
54-
New-Item -ItemType Directory $DownloadPath | Out-Null
55-
}
56-
Write-Host "Using download path: $DownloadPath"
35+
# Get all .nupkg files in the packages path
36+
$packageFiles = Get-ChildItem -Path $PackagesPath -Filter '*.nupkg' -File
5737

58-
if ($NuGetExePath) {
59-
$nuget = $NuGetExePath
60-
} else {
61-
$downloadedNuGetExe = Join-Path $DownloadPath "nuget.exe"
62-
63-
# Download nuget.exe, if it doesn't already exist.
64-
if (!(Test-Path $downloadedNuGetExe)) {
65-
Write-Host "Downloading nuget.exe from $nugetExeUrl..."
66-
$ProgressPreference = 'SilentlyContinue'
67-
try {
68-
Invoke-WebRequest $nugetExeUrl -OutFile $downloadedNuGetExe
69-
$ProgressPreference = 'Continue'
70-
} catch {
71-
$ProgressPreference = 'Continue'
72-
Write-Error $_
73-
Write-Error "nuget.exe failed to download."
74-
exit
75-
}
76-
}
38+
if ($packageFiles.Count -eq 0) {
39+
Write-Host "No .nupkg files found in $PackagesPath"
40+
Write-Output "dotnet nuget verify succeeded (no packages to verify)."
41+
return
42+
}
7743

78-
$nuget = $downloadedNuGetExe
79-
}
44+
# Get the full paths of the package files
45+
$packagePaths = $packageFiles | ForEach-Object { $_.FullName }
8046

81-
Write-Host "Using nuget.exe path: $nuget"
82-
Write-Host " "
47+
# Execute dotnet nuget verify
48+
Write-Host "Executing dotnet nuget verify..."
49+
Write-Host $fence
50+
& $dotnet nuget verify $packagePaths
51+
Write-Host $fence
52+
Write-Host " "
8353

84-
# Download the latest version of the verification tool.
85-
Write-Host "Downloading the latest version of $packageId from $packageSource..."
86-
Write-Host $fence
87-
& $nuget install $packageId `
88-
-Prerelease `
89-
-OutputDirectory $DownloadPath `
90-
-Source $PackageSource
91-
Write-Host $fence
92-
Write-Host " "
93-
94-
if ($LASTEXITCODE -ne 0) {
95-
Write-Error "nuget.exe failed to fetch the verify tool."
96-
exit
54+
# Respond to the exit code.
55+
if ($LASTEXITCODE -ne 0) {
56+
Write-PipelineTelemetryError -Category 'NuGetValidation' -Message "dotnet nuget verify found some problems."
57+
ExitWithExitCode 1
58+
} else {
59+
Write-Output "dotnet nuget verify succeeded."
60+
}
9761
}
98-
99-
# Find the most recently downloaded tool
100-
Write-Host "Finding the most recently downloaded verification tool."
101-
$verifyProbePath = Join-Path $DownloadPath "$packageId.*"
102-
$verifyPath = Get-ChildItem -Path $verifyProbePath -Directory `
103-
| Sort-Object -Property LastWriteTime -Descending `
104-
| Select-Object -First 1
105-
$verify = Join-Path $verifyPath "tools\NuGet.VerifyMicrosoftPackage.exe"
106-
Write-Host "Using verification tool: $verify"
107-
Write-Host " "
108-
109-
# Execute the verification tool.
110-
Write-Host "Executing the verify tool..."
111-
Write-Host $fence
112-
& $verify $args
113-
Write-Host $fence
114-
Write-Host " "
115-
116-
# Respond to the exit code.
117-
if ($LASTEXITCODE -ne 0) {
118-
Write-Error "The verify tool found some problems."
119-
} else {
120-
Write-Output "The verify tool succeeded."
62+
catch {
63+
Write-Host $_.ScriptStackTrace
64+
Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_
65+
ExitWithExitCode 1
12166
}

eng/common/tools.ps1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
157157
return $global:_DotNetInstallDir
158158
}
159159

160-
# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism
161-
$env:DOTNET_MULTILEVEL_LOOKUP=0
162-
163160
# Disable first run since we do not need all ASP.NET packages restored.
164161
$env:DOTNET_NOLOGO=1
165162

@@ -225,7 +222,6 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) {
225222
# Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build
226223
Write-PipelinePrependPath -Path $dotnetRoot
227224

228-
Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
229225
Write-PipelineSetVariable -Name 'DOTNET_NOLOGO' -Value '1'
230226

231227
return $global:_DotNetInstallDir = $dotnetRoot

eng/common/tools.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ function InitializeDotNetCli {
115115

116116
local install=$1
117117

118-
# Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism
119-
export DOTNET_MULTILEVEL_LOOKUP=0
120-
121118
# Disable first run since we want to control all package sources
122119
export DOTNET_NOLOGO=1
123120

@@ -166,7 +163,6 @@ function InitializeDotNetCli {
166163
# build steps from using anything other than what we've downloaded.
167164
Write-PipelinePrependPath -path "$dotnet_root"
168165

169-
Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0"
170166
Write-PipelineSetVariable -name "DOTNET_NOLOGO" -value "1"
171167

172168
# return value

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"runner": "Microsoft.Testing.Platform"
3838
},
3939
"msbuild-sdks": {
40-
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25603.2",
40+
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25604.3",
4141
"MSBuild.Sdk.Extras": "3.0.44"
4242
}
4343
}

0 commit comments

Comments
 (0)