@@ -372,6 +372,16 @@ Function RunApiDiff2
372
372
[ValidateNotNullOrEmpty ()]
373
373
[string ]
374
374
$attributesToExclude
375
+ ,
376
+ [Parameter (Mandatory = $true )]
377
+ [ValidateNotNullOrEmpty ()]
378
+ [string ]
379
+ $beforeFriendlyName
380
+ ,
381
+ [Parameter (Mandatory = $true )]
382
+ [ValidateNotNullOrEmpty ()]
383
+ [string ]
384
+ $afterFriendlyName
375
385
)
376
386
377
387
VerifyPathOrExit $apiDiffExe
@@ -381,7 +391,7 @@ Function RunApiDiff2
381
391
# All arguments:
382
392
# "https://github.com/dotnet/sdk/tree/main/src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Program.cs"
383
393
384
- RunCommand " $apiDiffExe -b $beforeFolder -a $afterFolder -o $outputFolder -tc $tableOfContentsFileNamePrefix -eattrs '$attributesToExclude '"
394
+ RunCommand " $apiDiffExe -b ' $beforeFolder ' -a ' $afterFolder ' -o ' $outputFolder ' -tc ' $tableOfContentsFileNamePrefix ' -eattrs '$attributesToExclude ' -bfn ' $beforeFriendlyName ' -afn ' $afterFriendlyName '"
385
395
}
386
396
387
397
Function CreateReadme
@@ -496,7 +506,7 @@ Function DownloadPackage
496
506
497
507
$refPackageName = " $fullSdkName .Ref"
498
508
499
- $nugetSource = $useNuget ? " https://api.nuget.org/v3/index.json" : " https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet10/nuget/v3/index.json"
509
+ $feed = $useNuget ? " https://api.nuget.org/v3/index.json" : " https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet10/nuget/v3/index.json"
500
510
501
511
$searchTerm = " "
502
512
If ($previewOrRC -eq " ga" )
@@ -508,7 +518,16 @@ Function DownloadPackage
508
518
$searchTerm = " $dotNetversion .*-$previewOrRC .$previewNumberVersion *"
509
519
}
510
520
511
- $results = Find-Package - AllVersions - Source $nugetSource - Name $refPackageName - AllowPrereleaseVersions | Where-Object - Property Version -Like $searchTerm | Sort-Object Version - Descending
521
+ $foundPackages = Find-Package - AllVersions - Source $feed - Name $refPackageName - AllowPrereleaseVersions - ErrorAction Continue
522
+
523
+ If ($foundPackages.Count -eq 0 )
524
+ {
525
+ Write-Error " No NuGet packages found with ref package name '$refPackageName ' in feed '$feed '"
526
+ Get-PackageSource - Name $refPackageName | Format-Table - Property Name, SourceUri
527
+ Write-Error " Exiting" - ErrorAction Stop
528
+ }
529
+
530
+ $results = $foundPackages | Where-Object - Property Version -Like $searchTerm | Sort-Object Version - Descending
512
531
513
532
If ($results.Count -eq 0 )
514
533
{
@@ -564,9 +583,6 @@ Function GetAttributesToExclude
564
583
# True when comparing 8.0 GA with 9.0 GA
565
584
$IsComparingReleases = ($PreviousDotNetVersion -Ne $CurrentDotNetVersion ) -And ($PreviousPreviewOrRC -Eq " ga" ) -And ($CurrentPreviewOrRC -eq " ga" )
566
585
567
- $currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
568
-
569
-
570
586
# # Check folders passed as parameters exist
571
587
572
588
VerifyPathOrExit $CoreRepo
@@ -635,12 +651,18 @@ RecreateFolder $windowsDesktopTargetFolder
635
651
636
652
# # Run the ApiDiff commands
637
653
654
+ # Comma separated docIDs of attribute types
638
655
$attributesToExclude = GetAttributesToExclude $AttributesToExcludeFilePath
639
656
640
- RunApiDiff2 $apiDiffExe $netCoreTargetFolder $netCoreBeforeDllFolder $netCoreAfterDllFolder $currentDotNetFullName $attributesToExclude
641
- RunApiDiff2 $apiDiffExe $aspNetCoreTargetFolder $aspNetCoreBeforeDllFolder $aspNetCoreAfterDllFolder $currentDotNetFullName $attributesToExclude
642
- RunApiDiff2 $apiDiffExe $windowsDesktopTargetFolder $windowsDesktopBeforeDllFolder $windowsDesktopAfterDllFolder $currentDotNetFullName $attributesToExclude
657
+ # Example: "10.0-preview2"
658
+ $currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
643
659
660
+ # Examples: ".NET 10 Preview 1" and ".NET 10 Preview 2"
661
+ $previousDotNetFriendlyName = GetDotNetFriendlyName $PreviousDotNetVersion $PreviousPreviewOrRC $PreviousPreviewNumberVersion
644
662
$currentDotNetFriendlyName = GetDotNetFriendlyName $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
645
663
664
+ RunApiDiff2 $apiDiffExe $netCoreTargetFolder $netCoreBeforeDllFolder $netCoreAfterDllFolder $currentDotNetFullName $attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName
665
+ RunApiDiff2 $apiDiffExe $aspNetCoreTargetFolder $aspNetCoreBeforeDllFolder $aspNetCoreAfterDllFolder $currentDotNetFullName $attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName
666
+ RunApiDiff2 $apiDiffExe $windowsDesktopTargetFolder $windowsDesktopBeforeDllFolder $windowsDesktopAfterDllFolder $currentDotNetFullName $attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName
667
+
646
668
CreateReadme $previewFolderPath $currentDotNetFriendlyName $currentDotNetFullName
0 commit comments