diff --git a/.build.ps1 b/.build.ps1 index 30b5060..23a9992 100644 --- a/.build.ps1 +++ b/.build.ps1 @@ -13,31 +13,25 @@ task AssertVersion { } } -task DotnetToolRestore { - exec { - dotnet tool restore - } -} - task DotnetRestore { exec { dotnet restore } } -task DotnetFormat DotnetToolRestore, DotnetRestore, { +task DotnetFormat DotnetRestore, { exec { dotnet format --no-restore } } -task DotnetFormatCheck DotnetToolRestore, DotnetRestore, { +task DotnetFormatCheck DotnetRestore, { exec { dotnet format --no-restore --verify-no-changes } } -task DotnetBuild DotnetToolRestore, DotnetRestore, { +task DotnetBuild DotnetRestore, { exec { dotnet build --no-restore } diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index 5497a4c..0000000 --- a/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "messagepack.generator": { - "version": "2.5.129", - "commands": [ - "mpc" - ] - } - } -} \ No newline at end of file diff --git a/samples/ConsoleApp/ConsoleApp.csproj b/samples/ConsoleApp/ConsoleApp.csproj index 7b3c19d..6634d2c 100644 --- a/samples/ConsoleApp/ConsoleApp.csproj +++ b/samples/ConsoleApp/ConsoleApp.csproj @@ -3,6 +3,7 @@ net8.0-windows Exe + true diff --git a/samples/Directory.Packages.props b/samples/Directory.Packages.props index 365e396..8abc4dc 100644 --- a/samples/Directory.Packages.props +++ b/samples/Directory.Packages.props @@ -5,6 +5,8 @@ + + diff --git a/samples/GenericHost/GenericHost.csproj b/samples/GenericHost/GenericHost.csproj index 56cf806..8811054 100644 --- a/samples/GenericHost/GenericHost.csproj +++ b/samples/GenericHost/GenericHost.csproj @@ -3,9 +3,12 @@ net8.0-windows Exe + true + + @@ -15,12 +18,4 @@ - - - - - - - - diff --git a/samples/GenericHost/MessagePackOptions.cs b/samples/GenericHost/MessagePackOptions.cs index db04e66..af93c4c 100644 --- a/samples/GenericHost/MessagePackOptions.cs +++ b/samples/GenericHost/MessagePackOptions.cs @@ -9,7 +9,7 @@ internal static class MessagePackOptions MessagePackSerializerOptions.Standard .WithResolver( CompositeResolver.Create( - GenericHostGeneratedResolver.Instance, + MessageResolver.Instance, StandardResolver.Instance ) ); diff --git a/samples/GenericHost/WorkerMessage.cs b/samples/GenericHost/WorkerMessage.cs index 31f9d49..9bc5fc0 100644 --- a/samples/GenericHost/WorkerMessage.cs +++ b/samples/GenericHost/WorkerMessage.cs @@ -2,6 +2,9 @@ namespace GenericHost; +[GeneratedMessagePackResolver] +public partial class MessageResolver; + [MessagePackObject] public class WorkerMessage { diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 4d4af9b..5fdc7cb 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -5,7 +5,8 @@ - + + diff --git a/src/TinyIpc/MessagePackOptions.cs b/src/TinyIpc/MessagePackOptions.cs index f9f1802..bb817f3 100644 --- a/src/TinyIpc/MessagePackOptions.cs +++ b/src/TinyIpc/MessagePackOptions.cs @@ -1,5 +1,6 @@ using MessagePack; using MessagePack.Resolvers; +using TinyIpc.Messaging; namespace TinyIpc; @@ -9,7 +10,7 @@ internal static class MessagePackOptions MessagePackSerializerOptions.Standard .WithResolver( CompositeResolver.Create( - TinyIpcGeneratedResolver.Instance, + LogBookResolver.Instance, StandardResolver.Instance ) ); diff --git a/src/TinyIpc/Messaging/TinyMessageBus.cs b/src/TinyIpc/Messaging/TinyMessageBus.cs index 34fc687..92933d6 100644 --- a/src/TinyIpc/Messaging/TinyMessageBus.cs +++ b/src/TinyIpc/Messaging/TinyMessageBus.cs @@ -428,6 +428,9 @@ private static LogBook DeserializeLogBook(Stream stream) private static partial void LogReceiveError(ILogger logger, Exception exception, long id); } +[GeneratedMessagePackResolver] +public partial class LogBookResolver; + [MessagePackObject] public sealed class LogBook { diff --git a/src/TinyIpc/TinyIpc.csproj b/src/TinyIpc/TinyIpc.csproj index 8b4a96f..d1da12c 100644 --- a/src/TinyIpc/TinyIpc.csproj +++ b/src/TinyIpc/TinyIpc.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net6.0;net8.0 @@ -16,6 +16,7 @@ + @@ -26,12 +27,4 @@ - - - - - - - -