From 093a26e34a3c575ee957ea7238ff1a0405b6e929 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 19 Jun 2024 12:15:09 -0700 Subject: [PATCH 1/2] Change the nuget feed to use the governed feed --- nuget.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget.config b/nuget.config index 654858614..a10ce9b3d 100644 --- a/nuget.config +++ b/nuget.config @@ -2,7 +2,7 @@ - + From d10d93405c01972384f90460494c29b3b6be95d9 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 19 Jun 2024 14:22:25 -0700 Subject: [PATCH 2/2] Add 'Update-CFSFeed' to help update the feed when there is package changes --- tools/helper.psm1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/helper.psm1 b/tools/helper.psm1 index 29ba9f06f..b8056de65 100644 --- a/tools/helper.psm1 +++ b/tools/helper.psm1 @@ -339,3 +339,26 @@ function Test-XUnitTestResults throw "$($failedTests.failed) tests failed" } } + +<# +.SYNOPSIS + Run 'dotnet restore' for all the target runtime that we are interested in to + update packages on the CFS feed. + This needs to be run on a MS employee's dev machine whenever there is update + to the NuGet packages used in PSReadLine repo, so that the package and all its + dependencies can be pull into the CFS feed from upstream feed. +#> +function Update-CFSFeed +{ + $rids = @('win-x64', 'win-arm64', 'linux-x64', 'linux-arm', 'linux-arm64', 'osx-x64', 'osx-arm64') + + Write-Host "1. clear all NuGet caches on the local machine." -ForegroundColor Green + dotnet nuget locals all -c + + Write-Host "2. restore for target runtimes." -ForegroundColor Green + foreach ($rid in $rids) { + Write-Host " - $rid" -ForegroundColor Green + dotnet restore -r $rid ../test/PSReadLine.Tests.csproj + dotnet restore -r $rid ../MockPSConsole/MockPSConsole.csproj + } +}