13
13
# -SdkRepo : The full path to your local clone of the dotnet/sdk repo.
14
14
# -TmpFolder : The full path to the folder where the assets will be downloaded, extracted and compared.
15
15
# -AttributesToExcludeFilePath : The full path to the file containing the attributes to exclude from the report. By default, it is "ApiDiffAttributesToExclude.txt" in the same folder as this script.
16
+ # -AssembliesToExcludeFilePath : The full path to the file containing the assemblies to exclude from the report. By default, it is "ApiDiffAssembliesToExclude.txt" in the same folder as this script.
16
17
# -UseNuGet : By default, the feed used is https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet10/nuget/v3/index.json , but if this is set to true, the feed used is https://api.nuget.org/v3/index.json
17
18
18
19
# Example:
@@ -70,7 +71,13 @@ Param (
70
71
[ValidateNotNullOrEmpty ()]
71
72
[string ]
72
73
$AttributesToExcludeFilePath = " ApiDiffAttributesToExclude.txt"
73
- ,
74
+ ,
75
+ [Parameter (Mandatory = $false )]
76
+ [ValidateNotNullOrEmpty ()]
77
+ [string ]
78
+ $AssembliesToExcludeFilePath = " ApiDiffAssembliesToExclude.txt"
79
+ ,
80
+
74
81
[Parameter (Mandatory = $false )]
75
82
[bool ]
76
83
$UseNuGet = $false
@@ -367,7 +374,12 @@ Function RunApiDiff2
367
374
[ValidateNotNullOrEmpty ()]
368
375
[string ]
369
376
$tableOfContentsFileNamePrefix
370
- ,
377
+ ,
378
+ [Parameter (Mandatory = $true )]
379
+ [ValidateNotNullOrEmpty ()]
380
+ [string ]
381
+ $assembliesToExclude
382
+ ,
371
383
[Parameter (Mandatory = $true )]
372
384
[ValidateNotNullOrEmpty ()]
373
385
[string ]
@@ -391,7 +403,7 @@ Function RunApiDiff2
391
403
# All arguments:
392
404
# "https://github.com/dotnet/sdk/tree/main/src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Program.cs"
393
405
394
- RunCommand " $apiDiffExe -b '$beforeFolder ' -a '$afterFolder ' -o '$outputFolder ' -tc '$tableOfContentsFileNamePrefix ' -eattrs '$attributesToExclude ' -bfn '$beforeFriendlyName ' -afn '$afterFriendlyName '"
406
+ RunCommand " $apiDiffExe -b '$beforeFolder ' -a '$afterFolder ' -o '$outputFolder ' -tc '$tableOfContentsFileNamePrefix ' -eas ' $assembliesToExclude ' - eattrs '$attributesToExclude ' -bfn '$beforeFriendlyName ' -afn '$afterFriendlyName '"
395
407
}
396
408
397
409
Function CreateReadme
@@ -561,7 +573,7 @@ Function DownloadPackage
561
573
$resultingPath.value = $dllPath
562
574
}
563
575
564
- Function GetAttributesToExclude
576
+ Function GetFileLinesAsCommaSeparaterList
565
577
{
566
578
Param (
567
579
[Parameter (Mandatory = $true )]
@@ -572,8 +584,8 @@ Function GetAttributesToExclude
572
584
573
585
VerifyPathOrExit $filePath
574
586
575
- $attributesToExclude = (Get-Content - Path $filePath ) -join " ,"
576
- Return $attributesToExclude
587
+ $lines = (Get-Content - Path $filePath ) -join " ,"
588
+ Return $lines
577
589
}
578
590
579
591
# ## Execution ###
@@ -651,8 +663,11 @@ RecreateFolder $windowsDesktopTargetFolder
651
663
652
664
# # Run the ApiDiff commands
653
665
654
- # Comma separated docIDs of attribute types
655
- $attributesToExclude = GetAttributesToExclude $AttributesToExcludeFilePath
666
+ # Comma separated docIDs of attribute types to exclude
667
+ $attributesToExclude = GetFileLinesAsCommaSeparaterList $AttributesToExcludeFilePath
668
+
669
+ # Comma separated list of assembly names to exclude
670
+ $assembliesToExclude = GetFileLinesAsCommaSeparaterList $AssembliesToExcludeFilePath
656
671
657
672
# Example: "10.0-preview2"
658
673
$currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
@@ -661,8 +676,8 @@ $currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVe
661
676
$previousDotNetFriendlyName = GetDotNetFriendlyName $PreviousDotNetVersion $PreviousPreviewOrRC $PreviousPreviewNumberVersion
662
677
$currentDotNetFriendlyName = GetDotNetFriendlyName $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
663
678
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
679
+ RunApiDiff2 $apiDiffExe $netCoreTargetFolder $netCoreBeforeDllFolder $netCoreAfterDllFolder $currentDotNetFullName $assembliesToExclude $ attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName
680
+ RunApiDiff2 $apiDiffExe $aspNetCoreTargetFolder $aspNetCoreBeforeDllFolder $aspNetCoreAfterDllFolder $currentDotNetFullName $assembliesToExclude $ attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName
681
+ RunApiDiff2 $apiDiffExe $windowsDesktopTargetFolder $windowsDesktopBeforeDllFolder $windowsDesktopAfterDllFolder $currentDotNetFullName $assembliesToExclude $ attributesToExclude $previousDotNetFriendlyName $currentDotNetFriendlyName
667
682
668
683
CreateReadme $previewFolderPath $currentDotNetFriendlyName $currentDotNetFullName
0 commit comments