Skip to content

Commit 822fabf

Browse files
committed
Make patching NuGet.Packaging.Core aware
1 parent 11dfaec commit 822fabf

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

SDKPatchTool/SDKPatch.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ function PatchNupkgs {
9999
#Copy the nupkg from nuget artifacts nupkg folder, to the temp folder, and extracted it
100100
$nupkg = Get-ChildItem -Path "$nupkgsPath" -Exclude "*.symbols.nupkg" | Where-Object {$_.Name -like "$nupkgId$suffix*"}
101101

102+
if(-not $nupkg -Or -not(Test-Path $nupkg))
103+
{
104+
Write-Error "$nupkgId$suffix not found in $nupkgsPath"
105+
return $false
106+
}
107+
102108
Copy-Item $nupkg -Destination $tempExtractFolder
103109

104110
$nupkgTemp = [System.IO.Path]::Combine($tempExtractFolder, $nupkg.Name)
@@ -326,7 +332,6 @@ function Patch
326332
"NuGet.Protocol",
327333
"NuGet.ProjectModel",
328334
"NuGet.Packaging",
329-
"NuGet.Packaging.Core",
330335
"NuGet.LibraryModel",
331336
"NuGet.Frameworks",
332337
"NuGet.DependencyResolver.Core",
@@ -336,6 +341,12 @@ function Patch
336341
"NuGet.CommandLine.XPlat",
337342
"NuGet.Credentials")
338343

344+
if (([int]($SDKVersion.Substring(0, 1)) -le 8) )
345+
{
346+
Write-Host "Adding nuget.packaging.core"
347+
$copiedNupkgIds += "NuGet.Packaging.Core"
348+
}
349+
339350
$packNupkg = Get-ChildItem -Path "$nupkgsPath" -Exclude '*.symbols.nupkg'| Where-Object {$_.Name -like "NuGet.Build.Tasks.Pack*"}
340351
$suffix = $packNupkg.Name -replace "NuGet.Build.Tasks.Pack", ""
341352

0 commit comments

Comments
 (0)