|
18 | 18 | <GenerateDocumentationFile>true</GenerateDocumentationFile>
|
19 | 19 | </PropertyGroup>
|
20 | 20 |
|
| 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 | + |
21 | 28 | <PropertyGroup Label="Packaging Metadata">
|
22 | 29 | <Authors>Cédric Luthi</Authors>
|
23 | 30 | <Copyright>Copyright © Cédric Luthi</Copyright>
|
|
51 | 58 | </ItemGroup>
|
52 | 59 |
|
53 | 60 | <ItemGroup>
|
54 |
| - <PackageReference Include="Microsoft.DotNet.ApiCompat" Version="7.0.0-*" PrivateAssets="all" /> |
55 | 61 | <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
|
56 | 62 | <PackageReference Include="MinVer" Version="2.5.0" PrivateAssets="all" />
|
57 | 63 | <PackageReference Include="Serilog" Version="2.0.0" />
|
58 | 64 | </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 | + |
75 | 66 | <Target Name="ValidateNuGetPackage" AfterTargets="Pack">
|
76 | 67 | <!-- For reference: the file `.config/dotnet-tools.json` was created by running `dotnet new tool-manifest && dotnet tool install dotnet-validate` -->
|
77 | 68 | <Exec Command="dotnet tool restore" />
|
|
0 commit comments