Skip to content

Commit

Permalink
feat: trimming and AOT support
Browse files Browse the repository at this point in the history
  • Loading branch information
Hertzole authored Jul 8, 2024
1 parent f3f000c commit 3227e8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GameJolt.NET/GameJolt.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Configurations>Debug;Release;Unity;Unity 2023;Force System Json;Disable GameJolt</Configurations>
<Platforms>AnyCPU</Platforms>
<IsTrimmable>true</IsTrimmable>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsAotCompatible>true</IsAotCompatible>

</PropertyGroup>

Expand Down
5 changes: 5 additions & 0 deletions GameJolt.NET/Serialization/System/SystemJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

namespace Hertzole.GameJolt
{
[UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.",
Justification = "Options are provided at runtime which includes (de)serializers for all types..")]
[UnconditionalSuppressMessage("Trimming",
"IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
Justification = "Options are provided at runtime which includes (de)serializers for all types.")]
internal sealed partial class SystemJsonSerializer : IGameJoltSerializer
{
private static readonly JsonSerializerOptions options = CreateOptions();
Expand Down

0 comments on commit 3227e8e

Please sign in to comment.