Skip to content

[ApiDiff] Implementation of the new ApiDiff that reuses GenAPI features #46425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 71 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2d1dc61
ApiDiff implementation
carlossanlop Feb 1, 2025
36fd38d
Resources
carlossanlop Feb 1, 2025
1cc4d22
Tests
carlossanlop Feb 1, 2025
80b53ef
Some infra files
carlossanlop Feb 1, 2025
7ac8c16
Address some of the feedback
carlossanlop Feb 3, 2025
bd88b38
Move the IO code to the business layer. Add a test that verifies the …
carlossanlop Feb 4, 2025
e0f9553
Address most of the feedback
carlossanlop Feb 6, 2025
9590165
Exclude diffplex DLLs from signing
carlossanlop Feb 6, 2025
c2d59aa
Fix markdown file title handling.
carlossanlop Feb 7, 2025
3e3bd44
Exclude from source build.
carlossanlop Feb 7, 2025
0027749
Allow overriding attribute list, add tests.
carlossanlop Feb 7, 2025
2c41297
improve attribute comment
carlossanlop Feb 7, 2025
6bbeb12
Add tests for implicit and explicit operators.
carlossanlop Feb 7, 2025
480696f
Implement API exclusion. Add tests.
carlossanlop Feb 7, 2025
33d3585
Remove Microsoft.CodeAnalysis.Worskpaces.Common PackageVersion from t…
carlossanlop Feb 13, 2025
9722f23
Unskip the checked tests.
carlossanlop Feb 13, 2025
edc45a9
Add exception resource strings, make some methods static, ignore newl…
carlossanlop Feb 18, 2025
91f2228
fix the resources error
carlossanlop Feb 19, 2025
a347588
Make some code async. Add option to exclude assemblies. Add tests.
carlossanlop Feb 21, 2025
223195b
Suppress additional diagnostics by default
carlossanlop Feb 27, 2025
5cad5e5
New resource
carlossanlop Feb 27, 2025
2bc7e7c
Fix bugs in attributes and events, add tests
carlossanlop Feb 27, 2025
b50eca1
remove static
carlossanlop Feb 27, 2025
6e12987
Add event tests
carlossanlop Feb 27, 2025
7422840
Support attributes that take arguments, add tests.
carlossanlop Feb 27, 2025
ebd0248
Truly async
carlossanlop Feb 27, 2025
8576cc7
Fix bug with abstract events where the field event declaration needs …
carlossanlop Feb 27, 2025
06d74b3
Add test that confirms that no files are getting overwritten when mul…
carlossanlop Feb 27, 2025
80232b7
Add arguments for before and after friendly name, separate that from …
carlossanlop Feb 28, 2025
befe4c6
Remove the body from methods and properties as requested in API diff PR.
carlossanlop Mar 4, 2025
7923d93
Add unchanged assembly and unchanged namespace tests.
carlossanlop Mar 5, 2025
364ec5c
Add destructor tests.
carlossanlop Mar 5, 2025
a4fbd5f
Add field list tests.
carlossanlop Mar 5, 2025
005d45e
Add an Options class for CSharpAssemblyDocumentGenerator to avoid gro…
carlossanlop Mar 5, 2025
265d10f
Moved some code from the generator to rewriters. Much faster.
carlossanlop Mar 6, 2025
b8829d4
Split test files into smaller ones
carlossanlop Mar 7, 2025
a9da515
Fix bug in TypeDeclarationCSharpSyntaxRewriter causing an extra space…
carlossanlop Mar 7, 2025
969358b
cons string t in AttributeNameSuffixRemover
carlossanlop Mar 7, 2025
09d06de
Fix bug in GlobalPrefixRemover preventing the removal of just global …
carlossanlop Mar 7, 2025
d4ef227
Fix bug in primitive conversion rewriter preventing the correct visit…
carlossanlop Mar 7, 2025
704507c
Fix bugs in body removal rewriter in accesors, operators and records
carlossanlop Mar 7, 2025
dc2d806
Add code specific for records in memory generator. Move the most debu…
carlossanlop Mar 7, 2025
e5eb224
Revert the TypeDeclarationCSharpSyntaxRewriter changes, they were wro…
carlossanlop Mar 7, 2025
21a1ecd
Don't truncate the attribute name, leave the type name full.
carlossanlop Mar 7, 2025
c6fdf8f
missing comments
carlossanlop Mar 14, 2025
ea4cbde
Missing docs
carlossanlop Mar 14, 2025
3ddb52c
Missing docs
carlossanlop Mar 14, 2025
9b5d333
Move private member under public ones
carlossanlop Mar 14, 2025
49dffe0
Replace the WaitAll with actual async method calls.
carlossanlop Mar 14, 2025
6c7cb26
Better split of code
carlossanlop Mar 14, 2025
62078f7
Fix sdk.sln merge conflict
carlossanlop Mar 25, 2025
5b4ef0a
Add enum support. Fix minor bug with records with members.
carlossanlop Mar 27, 2025
eb98ae9
Fix bug preventing attributes with arguments from getting either supp…
carlossanlop Mar 28, 2025
7810d71
Shorter test names.
carlossanlop Mar 28, 2025
d1e46e5
Yet one more attribute bug fix and test.
carlossanlop Mar 28, 2025
942de97
Use ExternalCertificateId to sign DiffPlex dependencies.
carlossanlop Apr 7, 2025
92f306c
Address UI feedback.
carlossanlop Apr 7, 2025
8eaa8c9
Take lists of files with elements to exclude, instead of directly pas…
carlossanlop Apr 8, 2025
7446164
Add missing case for including interface members.
carlossanlop Apr 8, 2025
2241b38
Merge remote-tracking branch 'dotnet/main' into ApiDiff
carlossanlop Apr 24, 2025
b4d4d47
Solve merge confict in sdk.sln
carlossanlop Apr 24, 2025
c27086d
System.CommandLine override no longer needed.
carlossanlop Apr 24, 2025
3d7e841
Delete launchSettings.json
carlossanlop Apr 25, 2025
a5fe497
Update System.CommandLine usage to match latest version's API surface.
carlossanlop Apr 25, 2025
970ca19
test typo
carlossanlop Apr 25, 2025
27ca575
No resources needed yet
carlossanlop Apr 25, 2025
373eb30
Remove Required from optioNTableOfContentsTitle
carlossanlop Apr 25, 2025
37203a0
Set IsShippingPackage to false
carlossanlop Apr 25, 2025
2f050e3
The default attributes to exclude list should only apply to the ApiDi…
carlossanlop Apr 25, 2025
0c8b15a
Delete xlfs
carlossanlop Apr 25, 2025
dc02b78
Merge branch 'main' into ApiDiff
carlossanlop Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,15 @@

# Compatibility tools owned by runtime team
/src/Compatibility/ @dotnet/area-infrastructure-libraries

# Area-ApiCompat
/test/Microsoft.DotNet.ApiCompatibility*/ @dotnet/area-infrastructure-libraries
/test/Microsoft.DotNet.ApiCompat*/ @dotnet/area-infrastructure-libraries
/test/Microsoft.DotNet.PackageValidation*/ @dotnet/area-infrastructure-libraries

# Area-ApiDiff
/test/Microsoft.DotNet.ApiDiff.Tests/ @dotnet/area-infrastructure-libraries

# Area-GenAPI
/src/Compatibility/GenAPI/ @dotnet/area-infrastructure-libraries
/src/Compatibility/Microsoft.DotNet.ApiSymbolExtensions/ @dotnet/area-infrastructure-libraries
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<PackageVersion Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersPackageVersion)" />
<PackageVersion Include="System.CodeDom" Version="$(SystemCodeDomPackageVersion)" />
<PackageVersion Include="System.CommandLine" Version="$(SystemCommandLineVersion)" />
<PackageVersion Include="System.CommandLine.NamingConventionBinder" Version="$(SystemCommandLineNamingConventionBinderVersion)" />
<PackageVersion Include="System.Composition.AttributedModel" Version="$(SystemCompositionAttributedModelPackageVersion)" />
<PackageVersion Include="System.Composition.Convention" Version="$(SystemCompositionConventionPackageVersion)" />
<PackageVersion Include="System.Composition.Hosting" Version="$(SystemCompositionHostingPackageVersion)" />
Expand Down
13 changes: 12 additions & 1 deletion eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<FileSignInfo Include="PackageWithFakeNativeDep.dll" CertificateName="None" />
<FileSignInfo Include="dotnet-tool-with-output-name.dll" CertificateName="None" />

<!-- Third party DLLs used by tests -->
<!-- Third party DLLs used by tests-->
<FileSignInfo Include="Castle.Core.dll" CertificateName="None" />
<FileSignInfo Include="Moq.dll" CertificateName="None" />

Expand Down Expand Up @@ -71,6 +71,17 @@
<FileSignInfo Include="@(MacOSPkg->'%(Filename)%(Extension)')" CertificateName="MacDeveloperWithNotarization" />
</ItemGroup>

<!-- Third party DLLs used in src projects that are not participating in source-build -->
<ItemGroup>
<FileSignInfo Include="Argon.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="DiffEngine.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="DiffPlex.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="EmptyFiles.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="SimpleInfoName.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="Verify.dll" CertificateName="$(ExternalCertificateId)" />
<FileSignInfo Include="Verify.DiffPlex.dll" CertificateName="$(ExternalCertificateId)" />
</ItemGroup>

<ItemGroup>
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="MicrosoftSHA2" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<StyleCopAnalyzersPackageVersion>1.2.0-beta.435</StyleCopAnalyzersPackageVersion>
<WebDeploymentPackageVersion>4.0.5</WebDeploymentPackageVersion>
<SystemCommandLineVersion>2.0.0-beta5.25227.101</SystemCommandLineVersion>
<SystemCommandLineNamingConventionBinderVersion>2.0.0-beta5.25227.101</SystemCommandLineNamingConventionBinderVersion>
<MicrosoftCodeAnalysisAnalyzerTestingVersion>1.1.2-beta1.22216.1</MicrosoftCodeAnalysisAnalyzerTestingVersion>
<MicrosoftVisualBasicVersion>10.3.0</MicrosoftVisualBasicVersion>
<MicrosoftVisualStudioSetupConfigurationInteropVersion>3.2.2146</MicrosoftVisualStudioSetupConfigurationInteropVersion>
Expand Down
30 changes: 28 additions & 2 deletions sdk.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.31903.286
MinimumVisualStudioVersion = 10.0.40219.1
Expand Down Expand Up @@ -537,6 +537,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.Net.Core.S
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.Templates", "src\Layout\VS.Redist.Common.NetCore.Templates\VS.Redist.Common.NetCore.Templates.proj", "{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiDiff", "ApiDiff", "{C66B5859-B05E-5DF4-58E9-78CA919DB89A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ApiDiff", "ApiDiff", "{AFA55F45-CFCB-9821-A210-2D3496088416}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.ApiDiff.Tool", "src\Compatibility\ApiDiff\Microsoft.DotNet.ApiDiff.Tool\Microsoft.DotNet.ApiDiff.Tool.csproj", "{3F0093BF-A64D-4EE8-8A2A-22800BB25CFF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.ApiDiff.Tests", "test\Microsoft.DotNet.ApiDiff.Tests\Microsoft.DotNet.ApiDiff.Tests.csproj", "{A57B724D-D12B-483E-82F2-2183DEA2DFA7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.ApiDiff", "src\Compatibility\ApiDiff\Microsoft.DotNet.ApiDiff\Microsoft.DotNet.ApiDiff.csproj", "{4F23A9C8-945A-A4F4-51E9-FCA215943C0D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1023,7 +1033,18 @@ Global
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
{3F0093BF-A64D-4EE8-8A2A-22800BB25CFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F0093BF-A64D-4EE8-8A2A-22800BB25CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F0093BF-A64D-4EE8-8A2A-22800BB25CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F0093BF-A64D-4EE8-8A2A-22800BB25CFF}.Release|Any CPU.Build.0 = Release|Any CPU
{A57B724D-D12B-483E-82F2-2183DEA2DFA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A57B724D-D12B-483E-82F2-2183DEA2DFA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A57B724D-D12B-483E-82F2-2183DEA2DFA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A57B724D-D12B-483E-82F2-2183DEA2DFA7}.Release|Any CPU.Build.0 = Release|Any CPU
{4F23A9C8-945A-A4F4-51E9-FCA215943C0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F23A9C8-945A-A4F4-51E9-FCA215943C0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F23A9C8-945A-A4F4-51E9-FCA215943C0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F23A9C8-945A-A4F4-51E9-FCA215943C0D}.Release|Any CPU.Build.0 = Release|Any CPU
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
Expand Down Expand Up @@ -1211,6 +1232,11 @@ Global
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
{C5C4F9CA-25B8-2B20-826D-EA93F667C316} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
{6A7E16BE-FF2F-7927-AAF7-366CC0C42AE4} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
{C66B5859-B05E-5DF4-58E9-78CA919DB89A} = {44E564E1-AE0D-4313-A4E9-CBF2109397E3}
{AFA55F45-CFCB-9821-A210-2D3496088416} = {3AD322BF-405B-4A53-9858-51CF66E8509F}
{3F0093BF-A64D-4EE8-8A2A-22800BB25CFF} = {C66B5859-B05E-5DF4-58E9-78CA919DB89A}
{A57B724D-D12B-483E-82F2-2183DEA2DFA7} = {AFA55F45-CFCB-9821-A210-2D3496088416}
{4F23A9C8-945A-A4F4-51E9-FCA215943C0D} = {C66B5859-B05E-5DF4-58E9-78CA919DB89A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB8F26CE-4DE6-433F-B32A-79183020BBD6}
Expand Down
9 changes: 9 additions & 0 deletions src/Compatibility/ApiDiff/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>

<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<SkipMicrosoftCodeAnalysisCSharpPinning>true</SkipMicrosoftCodeAnalysisCSharpPinning>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
T:System.AttributeUsageAttribute
T:System.ComponentModel.EditorBrowsableAttribute
T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute
T:System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetToolMinimum)</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>true</IsPackable>
<IsShippingPackage>false</IsShippingPackage>
<PackAsTool>true</PackAsTool>
<ToolCommandName>apidiff</ToolCommandName>
<PackageDescription>Tool to emit markdown diffs between sets of assemblies.</PackageDescription>
<DotNetBuildSourceOnly>false</DotNetBuildSourceOnly>
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
</PropertyGroup>

<ItemGroup>
<None Update="AttributesToExclude.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Microsoft.DotNet.ApiSymbolExtensions\Microsoft.DotNet.ApiSymbolExtensions.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.ApiDiff\Microsoft.DotNet.ApiDiff.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" />
</ItemGroup>

</Project>
Loading