Run trim analyzer (#65870)
authorSven Boemer <sbomer@gmail.com>
Thu, 3 Mar 2022 22:22:30 +0000 (14:22 -0800)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 22:22:30 +0000 (14:22 -0800)
commit6246f84506a7f0a2cf990c2fddd7225691f4bc89
tree9798579b768b1c816d75318d40a5ad96df893e7f
parent9174037cc6b58de847c9c88b7dcceef2b4fda440
Run trim analyzer (#65870)

* Use SDK logic for IsTrimmable

* Address some analyzer warnings

* Disable analyzer when baseline suppressions exist

* Don't mark unannotated test project as trimmable

* Add nativeaot annotations

* Add suppression in windows-only code

* Import illink.targets only when trimming mobile tests

* Don't run analyzer on unannotated windows OOBs

* PR feedback

Use pragma instead of UnconditionalSuppressMessage
30 files changed:
eng/illink.targets
eng/testing/tests.mobile.targets
eng/versioning.targets
src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/InMemoryAssemblyLoader.cs
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs
src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Dispensers/DispenserFactory.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/Dispensers/DispenserThatReusesAsLongAsKeyIsAlive.cs
src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/ReflectionCoreCallbacksImplementation.cs
src/libraries/Microsoft.Diagnostics.Tracing.EventSource.Redist/src/Microsoft.Diagnostics.Tracing.EventSource.Redist.csproj
src/libraries/Microsoft.Extensions.DependencyInjection.Specification.Tests/src/Microsoft.Extensions.DependencyInjection.Specification.Tests.csproj
src/libraries/System.CodeDom/src/System.CodeDom.csproj
src/libraries/System.ComponentModel.Composition.Registration/src/System.ComponentModel.Composition.Registration.csproj
src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs
src/libraries/System.Composition.Convention/src/System.Composition.Convention.csproj
src/libraries/System.Composition.Hosting/src/System.Composition.Hosting.csproj
src/libraries/System.Composition.TypedParts/src/System.Composition.TypedParts.csproj
src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
src/libraries/System.Data.Common/src/System/Data/DataSet.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj
src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs
src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SurrogateDataContract.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptoConfigForwarder.cs
src/libraries/System.Speech/src/System.Speech.csproj
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitCachingMemberAccessor.cs
src/mono/System.Private.CoreLib/src/System/TypeSpec.cs