Skip to content

Commit c31809f

Browse files
committed
Add --exclude-compiler-generated and --respect-internals to GenAPI commands
- exclude `@(Reference)` items for .Sources projects - ignore CS0169 warnings in ref/ projects - some newly-generated types encounter this warning - add exclusions related to nullable reference types due to dotnet/arcade#4488 (part 5) - add exclusions to avoid System.Buffers conflicts with MessagePack submodule - add exclusion for async use - remove exclusions for properties w/ `internal set` - remove exclusions for GenAPI NREs - remove exclusions related to dotnet/arcade#2031 aka dotnet/arcade#2033 aka dotnet/arcade#4488 (part 6)
1 parent 623a31b commit c31809f

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

eng/GenAPI.exclusions.txt

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1-
# Manually implemented - https://github.com/dotnet/arcade/pull/2033
2-
T:Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame
3-
# Manually implemented - https://github.com/dotnet/arcade/issues/2066
4-
T:Microsoft.AspNetCore.Mvc.ApplicationModels.PageParameterModel
5-
T:Microsoft.AspNetCore.Mvc.ApplicationModels.PagePropertyModel
6-
# Manually implemented - Need to include internal setter
7-
P:Microsoft.AspNetCore.Mvc.Razor.Infrastructure.TagHelperMemoryCacheProvider.Cache
8-
P:Microsoft.AspNetCore.Mvc.RazorPages.RazorPagesOptions.Conventions
9-
P:Microsoft.AspNetCore.Routing.Matching.CandidateState.Values
10-
P:Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.KestrelServerOptions
11-
# public structs with public fields that GenAPI doesn't handle
12-
T:Microsoft.AspNetCore.Components.EventCallback
13-
T:Microsoft.AspNetCore.Components.EventCallback`1
14-
# Break GenAPI - https://github.com/dotnet/arcade/issues/4488
15-
T:Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.<CreateInitialRenderAsync>d__17
16-
T:Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.<RenderComponentAsync>d__8
17-
T:Microsoft.AspNetCore.Mvc.ApplicationModels.ActionAttributeRouteModel.<>c
18-
T:Microsoft.AspNetCore.Mvc.ApplicationModels.ActionAttributeRouteModel.<GetAttributeRoutes>d__3
19-
T:Microsoft.AspNetCore.Mvc.ControllerBase.<TryUpdateModelAsync>d__181`1
20-
T:Microsoft.AspNetCore.Mvc.ControllerBase.<TryUpdateModelAsync>d__183`1
21-
T:Microsoft.AspNetCore.Mvc.ControllerBase.<TryUpdateModelAsync>d__184`1
22-
T:Microsoft.AspNetCore.Mvc.ControllerBase.<TryUpdateModelAsync>d__187
23-
T:Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0
24-
T:Microsoft.AspNetCore.Mvc.ModelBinding.CompositeValueProvider.<TryCreateAsync>d__4
25-
T:Microsoft.AspNetCore.Mvc.Routing.ConsumesMatcherPolicy.<>c
1+
# Excluded to avoid conflicts between System.Buffers.dll and MessagePack submodule
2+
T:System.Buffers.SequenceReaderExtensions
3+
T:System.Buffers.SequenceReader`1
4+
# Manually implemented - https://github.com/dotnet/arcade/issues/4488 problem (5), #nullable not generated.
5+
T:Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker
6+
M:Microsoft.AspNetCore.Mvc.MvcCoreLoggerExtensions.ActionScope(Microsoft.Extensions.Logging.ILogger,Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor)
7+
M:Microsoft.AspNetCore.Mvc.ViewFeatures.MvcViewFeaturesLoggerExtensions.ViewComponentScope(Microsoft.Extensions.Logging.ILogger,Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext)
8+
# As above but relevant only when using GenAPI with --all because these methods are private.
9+
M:Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeAsyncCore(Microsoft.Extensions.Internal.ObjectMethodExecutor,Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext)
10+
M:Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeSyncCore(Microsoft.Extensions.Internal.ObjectMethodExecutor,Microsoft.AspNetCore.Mvc.ViewComponents.ViewComponentContext)
11+
# Manually implemented to avoid need to generate async keywords and await Task.Delay(...) statements everywhere.
12+
M:Microsoft.AspNetCore.SignalR.Internal.AsyncEnumerableAdapters.MakeAsyncEnumerableFromChannel``1(System.Threading.Channels.ChannelReader{``0},System.Threading.CancellationToken)

eng/targets/CSharp.ReferenceAssembly.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<PropertyGroup>
33
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
44
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
5-
<NoWarn>$(NoWarn);CS0618;PUB0001</NoWarn>
5+
<NoWarn>$(NoWarn);CS0169;CS0618;PUB0001</NoWarn>
66
</PropertyGroup>
77
</Project>

eng/targets/ReferenceAssembly.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
--out "$(_RefSourceFileOutputPath)"
7878
--header-file "$(RepoRoot)/eng/LicenseHeader.txt"
7979
--exclude-api-list "$(RepoRoot)/eng/GenAPI.exclusions.txt"
80+
--respect-internals
81+
--exclude-compiler-generated
8082
]]>
8183
</_GenApiArguments>
8284
</PropertyGroup>
@@ -98,7 +100,7 @@
98100
<_ReferenceAssemblyCompileItems Include="../src/Properties/AssemblyInfo.cs"
99101
Condition="Exists('$(MSBuildProjectDirectory)/Properties/AssemblyInfo.cs')" />
100102
<FilteredOriginalReferences Include="%(_OriginalReferences.Identity)"
101-
Condition="'%(_OriginalReferences.NuGetPackageId)' == '' AND '%(_OriginalReferences.PrivateAssets)' != 'All'" />
103+
Condition="'%(_OriginalReferences.NuGetPackageId)' == '' AND '%(_OriginalReferences.PrivateAssets)' != 'All' AND '%(_OriginalReferences.IsSharedSource)' != 'true' " />
102104

103105
<_ReferenceAssemblyItems
104106
Include="@(_ReferenceAssemblyCompileItems->'&lt;Compile Include=&quot;%(Identity)&quot; /&gt;')" />

0 commit comments

Comments
 (0)