From ce7fe0b89d947eaff8cf35d987515d3ee313b19a Mon Sep 17 00:00:00 2001 From: Lucian Bargaoanu Date: Wed, 13 May 2020 12:21:40 +0300 Subject: [PATCH 1/2] ApiCompat: Allow setting ApiCompatExcludeNonBrowsable in the csproj --- .../build/Microsoft.DotNet.ApiCompat.targets | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.DotNet.ApiCompat/build/Microsoft.DotNet.ApiCompat.targets b/src/Microsoft.DotNet.ApiCompat/build/Microsoft.DotNet.ApiCompat.targets index 6bd14e266e7..eef3f63d3e8 100644 --- a/src/Microsoft.DotNet.ApiCompat/build/Microsoft.DotNet.ApiCompat.targets +++ b/src/Microsoft.DotNet.ApiCompat/build/Microsoft.DotNet.ApiCompat.targets @@ -67,6 +67,7 @@ $(ApiCompatArgs) --contract-depends "@(_ContractDependencyDirectories, ',')," $(ApiCompatArgs) --exclude-attributes "$(ApiCompatExcludeAttributeList)" $(ApiCompatArgs) --enforce-optional-rules + $(ApiCompatArgs) --exclude-non-browsable $(ApiCompatArgs) --baseline "$(ApiCompatBaseline)" $(ApiCompatArgs) --impl-dirs "$(IntermediateOutputPath),@(_DependencyDirectories, ',')," $(ApiCompatArgs) $(AdditionalApiCompatOptions) @@ -128,6 +129,7 @@ $(MatchingRefApiCompatArgs) --right-operand reference $(MatchingRefApiCompatArgs) --exclude-attributes "$(ApiCompatExcludeAttributeList)" $(MatchingRefApiCompatArgs) --enforce-optional-rules + $(MatchingRefApiCompatArgs) --exclude-non-browsable $(MatchingRefApiCompatArgs) --baseline "$(MatchingRefApiCompatBaseline)" $(MatchingRefApiCompatArgs) --impl-dirs "@(_ImplementationDependencyDirectories, ',')," Date: Wed, 13 May 2020 12:39:28 +0300 Subject: [PATCH 2/2] Update README.md --- src/Microsoft.DotNet.ApiCompat/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.DotNet.ApiCompat/README.md b/src/Microsoft.DotNet.ApiCompat/README.md index 4f02686b350..8b6c07030da 100644 --- a/src/Microsoft.DotNet.ApiCompat/README.md +++ b/src/Microsoft.DotNet.ApiCompat/README.md @@ -27,6 +27,7 @@ When API Compat identifies an error it will log the error and fail the build. I - `$(RunMatchingRefApiCompat)` - true to run APICompat treating project output as *contract* and `@(ResolvedMatchingContract)` as *implementation*, defaults to false. This is also known as reverse API compat and can help ensure that every public API defined in a project is exposed in `@(ResolvedMatchingContract)`. - `$(ApiCompatExcludeAttributeList)` - Attributes to exclude from APICompat checks. This is a text file containing types in DocID format, EG: T:Namespace.TypeName. - `$(ApiCompatEnforceOptionalRules)` - true to enforce optional rules, default is false. An example of an optional rule is parameter naming which can break source compatibility but not binary compatibility. +- `$(ApiCompatExcludeNonBrowsable)` - true to exclude types marked with EditorBrowsable(EditorBrowsableState.Never), default is false. - `$(ApiCompatBaseline)` - path to baseline file used to suppress errors, defaults to a file in the project directory. - `$(BaselineAllAPICompatError)` - true to indicate that the baseline file should be rewritten suppressing all API compat errors. You may set this when building the project to conveniently update the baseline when you wish to suppress them, eg: `dotnet msbuild /p:BaselineAllAPICompatError=true` - `$(MatchingRefApiCompatBaseline)` - same as `$(ApiCompatBaseline)` but for reverse API compat.