Skip to content

Commit d784e67

Browse files
committed
Add assemblies to exclude
1 parent 5db35a0 commit d784e67

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
netstandard.dll
2+
mscorlib.dll

release-notes/RunApiDiff2.ps1

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# -SdkRepo : The full path to your local clone of the dotnet/sdk repo.
1414
# -TmpFolder : The full path to the folder where the assets will be downloaded, extracted and compared.
1515
# -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.
1617
# -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
1718

1819
# Example:
@@ -70,7 +71,13 @@ Param (
7071
[ValidateNotNullOrEmpty()]
7172
[string]
7273
$AttributesToExcludeFilePath = "ApiDiffAttributesToExclude.txt"
73-
,
74+
,
75+
[Parameter(Mandatory = $false)]
76+
[ValidateNotNullOrEmpty()]
77+
[string]
78+
$AssembliesToExcludeFilePath = "ApiDiffAssembliesToExclude.txt"
79+
,
80+
7481
[Parameter(Mandatory=$false)]
7582
[bool]
7683
$UseNuGet = $false
@@ -367,7 +374,12 @@ Function RunApiDiff2
367374
[ValidateNotNullOrEmpty()]
368375
[string]
369376
$tableOfContentsFileNamePrefix
370-
,
377+
,
378+
[Parameter(Mandatory = $true)]
379+
[ValidateNotNullOrEmpty()]
380+
[string]
381+
$assembliesToExclude
382+
,
371383
[Parameter(Mandatory=$true)]
372384
[ValidateNotNullOrEmpty()]
373385
[string]
@@ -391,7 +403,7 @@ Function RunApiDiff2
391403
# All arguments:
392404
# "https://github.com/dotnet/sdk/tree/main/src/Compatibility/ApiDiff/Microsoft.DotNet.ApiDiff.Tool/Program.cs"
393405

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'"
395407
}
396408

397409
Function CreateReadme
@@ -561,7 +573,7 @@ Function DownloadPackage
561573
$resultingPath.value = $dllPath
562574
}
563575

564-
Function GetAttributesToExclude
576+
Function GetFileLinesAsCommaSeparaterList
565577
{
566578
Param (
567579
[Parameter(Mandatory=$true)]
@@ -572,8 +584,8 @@ Function GetAttributesToExclude
572584

573585
VerifyPathOrExit $filePath
574586

575-
$attributesToExclude = (Get-Content -Path $filePath) -join ","
576-
Return $attributesToExclude
587+
$lines = (Get-Content -Path $filePath) -join ","
588+
Return $lines
577589
}
578590

579591
### Execution ###
@@ -651,8 +663,11 @@ RecreateFolder $windowsDesktopTargetFolder
651663

652664
## Run the ApiDiff commands
653665

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
656671

657672
# Example: "10.0-preview2"
658673
$currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
@@ -661,8 +676,8 @@ $currentDotNetFullName = GetDotNetFullName $IsComparingReleases $CurrentDotNetVe
661676
$previousDotNetFriendlyName = GetDotNetFriendlyName $PreviousDotNetVersion $PreviousPreviewOrRC $PreviousPreviewNumberVersion
662677
$currentDotNetFriendlyName = GetDotNetFriendlyName $CurrentDotNetVersion $CurrentPreviewOrRC $CurrentPreviewNumberVersion
663678

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
667682

668683
CreateReadme $previewFolderPath $currentDotNetFriendlyName $currentDotNetFullName

0 commit comments

Comments
 (0)