-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Very first work on trimming compatibility
* Annotate composite types as incompatible with trimming, while suppressing warnings for applications which don't use them. * Create a very basic console test program for testing (#3820). We'll eventually run this in CI. Part of #3300 Part of #3820
- Loading branch information
Showing
15 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#if !NET5_0_OR_GREATER | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
// ReSharper disable once CheckNamespace | ||
namespace System.Diagnostics.CodeAnalysis | ||
{ | ||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)] | ||
sealed class RequiresUnreferencedCodeAttribute : Attribute | ||
{ | ||
public RequiresUnreferencedCodeAttribute(string message) | ||
{ | ||
Message = message; | ||
} | ||
|
||
public string Message { get; } | ||
|
||
public string? Url { get; set; } | ||
} | ||
|
||
[AttributeUsage( | ||
AttributeTargets.Field | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | | ||
AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Method | | ||
AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct, | ||
Inherited = false)] | ||
sealed class DynamicallyAccessedMembersAttribute : Attribute | ||
{ | ||
public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) | ||
{ | ||
MemberTypes = memberTypes; | ||
} | ||
|
||
public DynamicallyAccessedMemberTypes MemberTypes { get; } | ||
} | ||
|
||
[Flags] | ||
enum DynamicallyAccessedMemberTypes | ||
{ | ||
None = 0, | ||
PublicParameterlessConstructor = 0x0001, | ||
PublicConstructors = 0x0002 | PublicParameterlessConstructor, | ||
NonPublicConstructors = 0x0004, | ||
PublicMethods = 0x0008, | ||
NonPublicMethods = 0x0010, | ||
PublicFields = 0x0020, | ||
NonPublicFields = 0x0040, | ||
PublicNestedTypes = 0x0080, | ||
NonPublicNestedTypes = 0x0100, | ||
PublicProperties = 0x0200, | ||
NonPublicProperties = 0x0400, | ||
PublicEvents = 0x0800, | ||
NonPublicEvents = 0x1000, | ||
Interfaces = 0x2000, | ||
All = ~None | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)] | ||
sealed class UnconditionalSuppressMessageAttribute : Attribute | ||
{ | ||
public UnconditionalSuppressMessageAttribute(string category, string checkId) | ||
{ | ||
Category = category; | ||
CheckId = checkId; | ||
} | ||
|
||
public string Category { get; } | ||
public string CheckId { get; } | ||
public string? Scope { get; set; } | ||
public string? Target { get; set; } | ||
public string? MessageId { get; set; } | ||
public string? Justification { get; set; } | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>exe</OutputType> | ||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier> | ||
<PublishTrimmed>true</PublishTrimmed> | ||
<TrimMode>link</TrimMode> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="../../src/Npgsql/Npgsql.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Remove="GitHubActionsTestLogger" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.