forked from HiroyukiSakoh/EchoDotNetLite
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce source generation in System.Text.Json to fix warning IL2026
- Loading branch information
Showing
6 changed files
with
46 additions
and
8 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
11 changes: 11 additions & 0 deletions
11
...honetLite.Appendix/Smdn.Net.EchonetLite.Appendix/JsonSerializerSourceGenerationContext.cs
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,11 @@ | ||
// SPDX-FileCopyrightText: 2024 smdn <smdn@smdn.jp> | ||
// SPDX-License-Identifier: MIT | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Smdn.Net.EchonetLite.Appendix; | ||
|
||
// use source generation in System.Text.Json | ||
// ref: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation | ||
[JsonSerializable(typeof(SpecificationMaster.SpecificationMasterJsonObject))] | ||
[JsonSerializable(typeof(PropertyMaster))] | ||
internal partial class JsonSerializerSourceGenerationContext : JsonSerializerContext { } |
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
12 changes: 12 additions & 0 deletions
12
...onetLite/Smdn.Net.EchonetLite.Serialization.Json/JsonSerializerSourceGenerationContext.cs
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,12 @@ | ||
// SPDX-FileCopyrightText: 2024 smdn <smdn@smdn.jp> | ||
// SPDX-License-Identifier: MIT | ||
using System.Text.Json.Serialization; | ||
|
||
using Smdn.Net.EchonetLite.Protocol; | ||
|
||
namespace Smdn.Net.EchonetLite.Serialization.Json; | ||
|
||
// use source generation in System.Text.Json | ||
// ref: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation | ||
[JsonSerializable(typeof(Frame))] | ||
internal partial class JsonSerializerSourceGenerationContext : JsonSerializerContext { } |
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