diff --git a/nuget.config b/nuget.config index 654858614..a10ce9b3d 100644 --- a/nuget.config +++ b/nuget.config @@ -2,7 +2,7 @@ - + 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 + } +}