From 9ccc287654b9ef31c21ceb1ecd61d37d5cc618f7 Mon Sep 17 00:00:00 2001 From: Andy Howard Date: Sun, 13 Sep 2026 15:59:54 +0100 Subject: [PATCH] Reuse the shared NuGet package cache --- eng/README.md | 2 +- eng/validate.ps1 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/README.md b/eng/README.md index 5b8c3c1..ade8d6a 100644 --- a/eng/README.md +++ b/eng/README.md @@ -6,4 +6,4 @@ Run the complete BusinessMgr validation: .\eng\validate.ps1 ``` -Use `-SkipRestore` when packages are already restored. The script suppresses .NET first-run setup and banners, locates Visual Studio MSBuild because the Portal test project requires Visual Studio SSDT targets, builds serially, derives test output paths from each project's target framework, runs both test assemblies, stores test output under the ignored `TestResults/Validation` folder, checks the Git diff, and verifies working-tree line endings without modifying files. +Use `-SkipRestore` when packages are already restored. The script suppresses .NET first-run setup and banners, locates Visual Studio MSBuild because the Portal test project requires Visual Studio SSDT targets, builds serially, derives test output paths from each project's target framework, runs both test assemblies, stores test output under the ignored `TestResults/Validation` folder, checks the Git diff, and verifies working-tree line endings without modifying files. Its isolated `DOTNET_CLI_HOME` stores only CLI state; NuGet packages reuse `NUGET_PACKAGES` when already configured or the user's standard `.nuget/packages` cache. diff --git a/eng/validate.ps1 b/eng/validate.ps1 index 84b7519..563ad1f 100644 --- a/eng/validate.ps1 +++ b/eng/validate.ps1 @@ -7,12 +7,14 @@ $ErrorActionPreference = 'Stop' $repositoryRoot = Split-Path -Parent $PSScriptRoot $testResultsPath = Join-Path $repositoryRoot 'TestResults\Validation' $dotnetHome = Join-Path (Split-Path -Parent $repositoryRoot) '.dotnet-cli-validation' +$nugetPackagesPath = if ($env:NUGET_PACKAGES) { $env:NUGET_PACKAGES } else { Join-Path $env:USERPROFILE '.nuget\packages' } $env:DOTNET_CLI_HOME = $dotnetHome $env:DOTNET_GENERATE_ASPNET_CERTIFICATE = 'false' $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1' $env:DOTNET_CLI_TELEMETRY_OPTOUT = '1' $env:DOTNET_NOLOGO = '1' +$env:NUGET_PACKAGES = $nugetPackagesPath function Invoke-External {