Skip to content

Commit 7133cce

Browse files
committed
Replace Microsoft.DotNet.ApiCompat with the .NET 6 SDK builtin validation
See https://docs.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview
1 parent 5795850 commit 7133cce

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

src/Serilog.Formatting.Log4Net.csproj

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1919
</PropertyGroup>
2020

21+
<!-- Run `dotnet pack -p:GenerateCompatibilitySuppressionFile=true` to accept breaking changes
22+
See https://docs.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview for more information -->
23+
<PropertyGroup Label="API Validation">
24+
<EnablePackageValidation>true</EnablePackageValidation>
25+
<PackageValidationBaselineVersion>1.0.0-rc.4</PackageValidationBaselineVersion>
26+
</PropertyGroup>
27+
2128
<PropertyGroup Label="Packaging Metadata">
2229
<Authors>Cédric Luthi</Authors>
2330
<Copyright>Copyright © Cédric Luthi</Copyright>
@@ -51,27 +58,11 @@
5158
</ItemGroup>
5259

5360
<ItemGroup>
54-
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="7.0.0-*" PrivateAssets="all" />
5561
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
5662
<PackageReference Include="MinVer" Version="2.5.0" PrivateAssets="all" />
5763
<PackageReference Include="Serilog" Version="2.0.0" />
5864
</ItemGroup>
59-
60-
<!-- Run `dotnet build -p:BaselineAllAPICompatError=true` to accept breaking changes
61-
See https://stu.dev/check-for-breaking-changes-with-apicompat/ for more information -->
62-
<Target Name="SetupResolvedMatchingContract" BeforeTargets="ValidateApiCompatForSrc">
63-
<PropertyGroup>
64-
<ContractVersion>1.0.0-rc.4</ContractVersion>
65-
<ContractFilePath>$([System.IO.Path]::Combine($(NuGetPackageRoot),$(PackageId.ToLowerInvariant()),$(ContractVersion),'lib',$(TargetFramework),$(TargetFileName)))</ContractFilePath>
66-
</PropertyGroup>
67-
<ItemGroup>
68-
<ResolvedMatchingContract Include="$(ContractFilePath)" />
69-
</ItemGroup>
70-
<!-- We don't really want to validate the package here but `dotnet validate package remote ...` downloads and extract the NuGet package into the NuGet package root -->
71-
<Exec Command="dotnet tool restore" Condition="!Exists($(ContractFilePath))" />
72-
<Exec Command="dotnet validate package remote $(PackageId) --version $(ContractVersion)" StandardOutputImportance="low" IgnoreExitCode="true" Condition="!Exists($(ContractFilePath))" />
73-
</Target>
74-
65+
7566
<Target Name="ValidateNuGetPackage" AfterTargets="Pack">
7667
<!-- For reference: the file `.config/dotnet-tools.json` was created by running `dotnet new tool-manifest && dotnet tool install dotnet-validate` -->
7768
<Exec Command="dotnet tool restore" />

src/packages.lock.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
"version": 1,
33
"dependencies": {
44
".NETStandard,Version=v2.0": {
5-
"Microsoft.DotNet.ApiCompat": {
6-
"type": "Direct",
7-
"requested": "[7.0.0-*, )",
8-
"resolved": "7.0.0-beta.21609.2",
9-
"contentHash": "pOfKdWpM8cim4VpUebF7OGYNSm0ElAxEHvR/sXq0/o7WAAnEfbni+ixFwIi9X+179qpQ7e6w7Mzhh870Ay4Exg=="
10-
},
115
"Microsoft.SourceLink.GitHub": {
126
"type": "Direct",
137
"requested": "[1.1.1, )",

0 commit comments

Comments
 (0)