From 342248043a3f01508b36f4e008d4646b82e5b2ed Mon Sep 17 00:00:00 2001 From: neuecc Date: Thu, 29 Jun 2017 16:32:30 +0900 Subject: [PATCH] ready for 1.4.1 --- README.md | 22 +++++++++++++++++++ .../MessagePack.AspNetCoreMvcFormatter.nuspec | 4 ++-- nuget/MessagePack.ImmutableCollection.nuspec | 8 +++---- nuget/MessagePack.ReactiveProperty.nuspec | 8 +++---- nuget/MessagePack.UnityShims.nuspec | 8 +++---- nuget/MessagePack.nuspec | 4 ++-- nuget/push.bat | 10 ++++----- sandbox/SharedData/Class1.cs | 17 +++++++++++--- sandbox/SharedData/SharedData.csproj | 9 +++++--- sandbox/SharedData/packages.config | 1 - .../_AssemblyInfo.cs | 4 ++-- .../_AssemblyInfo.cs | 4 ++-- .../_AssemblyInfo.cs | 4 ++-- src/MessagePack.UnityShims/_AssemblyInfo.cs | 4 ++-- src/MessagePack/_AssemblyInfo.cs | 4 ++-- 15 files changed, 73 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 17ad76b9..9d99a67f 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,14 @@ I don't need type, I want to use like BinaryFormatter! You can use as typeless r Resolver is key customize point of MessagePack for C#. Details, please see [extension point](https://github.com/neuecc/MessagePack-CSharp#extension-pointiformatterresolver). +DataContract compatibility +--- +You can use `[DataContract]` instead of `[MessagePackObject]`. If type is marked DataContract, you can use `[DataMember]` instead of `[Key]` and `[Ignore]` instead of `[IgnoreDataMember]`. + +`[DataMember(Order = int)]` is same as `[Key(int)]`, `[DataMember(Name = string)]` is same as `[Key(string)]`. If use `[DataMember]`, same as `[Key(nameof(propertyname)]`. + +Using DataContract makes it a shared class library and you do not have to refer to MessagePack for C#. However, it is not included in analysis by Analyzer or code generation by `mpc.exe`. Also, functions like `UnionAttribute`, `MessagePackFormatterAttribute`, `SerializationConstructorAttribute` etc can not be used. For this reason, I recommend that you use the MessagePack for C# attribute basically. + Serialize ImmutableObject(SerializationConstructor) --- MessagePack for C# supports deserialize immutable object. For example, this struct can serialize/deserialize naturally. @@ -934,6 +942,20 @@ public class CustomObject Formatter is retrieved by `AttributeFormatterResolver`, it is included in `StandardResolver`. +Reserved Extension Types +--- +MessagePack for C# already used some messagepack ext type codes, be careful to use same ext code. + +| Resovler Name | Description | +| --- | --- | +| BuiltinResolver | Builtin primitive and standard classes resolver. It includes primitive(int, bool, string...) and there nullable, array and list. and some extra builtin types(Guid, Uri, BigInteger, etc...). | +| StandardResolver | Composited resolver. It resolves in the following order `builtin -> attribute -> dynamic enum -> dynamic generic -> dynamic union -> dynamic object -> primitive object`. This is the default of MessagePackSerializer. | +| ContractlessStandardResolver | Composited `StandardResolver`(except primitive) -> `DynamicContractlessObjectResolver` -> `DynamicObjectTypeFallbackResolver`. It enables contractless serialization. | +| PrimitiveObjectResolver | MessagePack primitive object resolver. It is used fallback in `object` type and supports `bool`, `char`, `sbyte`, `byte`, `short`, `int`, `long`, `ushort`, `uint`, `ulong`, `float`, `double`, `DateTime`, `string`, `byte[]`, `ICollection`, `IDictionary`. | +| DynamicObjectTypeFallbackResolver | It is used fallback in `object` type and resolve primitive object -> dynamic contractless object | +| AttributeFormatterResolver | Get formatter from `[MessagePackFormatter]` attribute. | + + for Unity --- You can install by package and includes source code. If build target as PC, you can use as is but if build target uses IL2CPP, you can not use `Dynamic***Resolver` so use pre-code generation. Please see [pre-code generation section](https://github.com/neuecc/MessagePack-CSharp#pre-code-generationunityxamarin-supports). diff --git a/nuget/MessagePack.AspNetCoreMvcFormatter.nuspec b/nuget/MessagePack.AspNetCoreMvcFormatter.nuspec index cc35ac70..f67e3e53 100644 --- a/nuget/MessagePack.AspNetCoreMvcFormatter.nuspec +++ b/nuget/MessagePack.AspNetCoreMvcFormatter.nuspec @@ -2,7 +2,7 @@ MessagePack.AspNetCoreMvcFormatter - 1.4.0 + 1.4.1 ASP.NET Core MVC Input/Output MessagePack formatter neuecc neuecc @@ -13,7 +13,7 @@ MsgPack, MessagePack, Serialization, Formatter, Serializer, aspnetcore, aspnetcoremvc - + diff --git a/nuget/MessagePack.ImmutableCollection.nuspec b/nuget/MessagePack.ImmutableCollection.nuspec index 7348ea41..c31f7ea9 100644 --- a/nuget/MessagePack.ImmutableCollection.nuspec +++ b/nuget/MessagePack.ImmutableCollection.nuspec @@ -2,7 +2,7 @@ MessagePack.ImmutableCollection - 1.4.0 + 1.4.1 MessagePack for C# Extension Support for ImmutableCollection neuecc neuecc @@ -17,15 +17,15 @@ - + - + - + diff --git a/nuget/MessagePack.ReactiveProperty.nuspec b/nuget/MessagePack.ReactiveProperty.nuspec index cc1d6a26..b1294f07 100644 --- a/nuget/MessagePack.ReactiveProperty.nuspec +++ b/nuget/MessagePack.ReactiveProperty.nuspec @@ -2,7 +2,7 @@ MessagePack.ReactiveProperty - 1.4.0 + 1.4.1 MessagePack for C# Extension Support for ReactiveProperty neuecc neuecc @@ -17,15 +17,15 @@ - + - + - + diff --git a/nuget/MessagePack.UnityShims.nuspec b/nuget/MessagePack.UnityShims.nuspec index e5c3c0b4..d9116ea9 100644 --- a/nuget/MessagePack.UnityShims.nuspec +++ b/nuget/MessagePack.UnityShims.nuspec @@ -2,7 +2,7 @@ MessagePack.UnityShims - 1.4.0 + 1.4.1 MessagePack for C# Extension Support for Unity(add pseudo Vector type and fast Vectory[] extension formatter) neuecc neuecc @@ -17,13 +17,13 @@ - + - + - + diff --git a/nuget/MessagePack.nuspec b/nuget/MessagePack.nuspec index d7e8433f..049365e6 100644 --- a/nuget/MessagePack.nuspec +++ b/nuget/MessagePack.nuspec @@ -2,14 +2,14 @@ MessagePack - 1.4.0 + 1.4.1 MessagePack for C# neuecc neuecc https://github.com/neuecc/MessagePack-CSharp/ false Extremely Fast MessagePack(MsgPack) Serializer for C#(.NET, .NET Core, Unity, Xamarin). - Add Stream API. + Add DataCotnract support. MsgPack, MessagePack, Serialization, Formatter, Serializer, Unity, Xamarin diff --git a/nuget/push.bat b/nuget/push.bat index 707b48d7..7f276801 100644 --- a/nuget/push.bat +++ b/nuget/push.bat @@ -1,6 +1,6 @@ -nuget push MessagePack.1.4.0.nupkg -Source https://www.nuget.org/api/v2/package -nuget push MessagePack.ImmutableCollection.1.4.0.nupkg -Source https://www.nuget.org/api/v2/package -nuget push MessagePack.ReactiveProperty.1.4.0.nupkg -Source https://www.nuget.org/api/v2/package -nuget push MessagePack.UnityShims.1.4.0.nupkg -Source https://www.nuget.org/api/v2/package -nuget push MessagePack.AspNetCoreMvcFormatter.1.4.0.nupkg -Source https://www.nuget.org/api/v2/package +nuget push MessagePack.1.4.1.nupkg -Source https://www.nuget.org/api/v2/package +nuget push MessagePack.ImmutableCollection.1.4.1.nupkg -Source https://www.nuget.org/api/v2/package +nuget push MessagePack.ReactiveProperty.1.4.1.nupkg -Source https://www.nuget.org/api/v2/package +nuget push MessagePack.UnityShims.1.4.1.nupkg -Source https://www.nuget.org/api/v2/package +nuget push MessagePack.AspNetCoreMvcFormatter.1.4.1.nupkg -Source https://www.nuget.org/api/v2/package REM nuget push MessagePackAnalyzer.1.6.0.nupkg -Source https://www.nuget.org/api/v2/package \ No newline at end of file diff --git a/sandbox/SharedData/Class1.cs b/sandbox/SharedData/Class1.cs index 2aecaa47..f9618d79 100644 --- a/sandbox/SharedData/Class1.cs +++ b/sandbox/SharedData/Class1.cs @@ -798,7 +798,7 @@ public class ArrayTestTest [MessagePackObject(true)] public class ComplexModel { - public IDictionary AdditionalProperty { get; } = new Dictionary(); + public IDictionary AdditionalProperty { get; private set; } public DateTimeOffset CreatedOn { get; set; } @@ -808,7 +808,13 @@ public class ComplexModel public DateTimeOffset UpdatedOn { get; set; } - public IList SimpleModels { get; } = new List(); + public IList SimpleModels { get; private set; } + + public ComplexModel() + { + AdditionalProperty = new Dictionary(); + SimpleModels = new List(); + } } [MessagePackObject(true)] @@ -823,7 +829,12 @@ public class SimpleModel public DateTime CreatedOn { get; set; } - public int Precision { get; set; } = 4; + public int Precision { get; set; } + + public SimpleModel() + { + Precision = 4; + } public decimal Money { diff --git a/sandbox/SharedData/SharedData.csproj b/sandbox/SharedData/SharedData.csproj index b69479c4..0812c2d2 100644 --- a/sandbox/SharedData/SharedData.csproj +++ b/sandbox/SharedData/SharedData.csproj @@ -33,9 +33,6 @@ false - - ..\..\packages\MessagePack.1.4.0\lib\net45\MessagePack.dll - @@ -56,5 +53,11 @@ + + + {7abb33ee-a2f1-492b-8daf-5df89f0f0b79} + MessagePack + + \ No newline at end of file diff --git a/sandbox/SharedData/packages.config b/sandbox/SharedData/packages.config index 392d71f4..3e14fde7 100644 --- a/sandbox/SharedData/packages.config +++ b/sandbox/SharedData/packages.config @@ -1,6 +1,5 @@  - \ No newline at end of file diff --git a/src/MessagePack.AspNetCoreMvcFormatter/_AssemblyInfo.cs b/src/MessagePack.AspNetCoreMvcFormatter/_AssemblyInfo.cs index 73e1f433..fdc4eea4 100644 --- a/src/MessagePack.AspNetCoreMvcFormatter/_AssemblyInfo.cs +++ b/src/MessagePack.AspNetCoreMvcFormatter/_AssemblyInfo.cs @@ -11,5 +11,5 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: Guid("7c1f59ed-3929-4cbb-8aca-b13139fbca3a")] -[assembly: AssemblyVersion("1.4.0")] -[assembly: AssemblyFileVersion("1.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.4.1")] +[assembly: AssemblyFileVersion("1.4.1")] \ No newline at end of file diff --git a/src/MessagePack.ImmutableCollection/_AssemblyInfo.cs b/src/MessagePack.ImmutableCollection/_AssemblyInfo.cs index d219ad70..8f21bb34 100644 --- a/src/MessagePack.ImmutableCollection/_AssemblyInfo.cs +++ b/src/MessagePack.ImmutableCollection/_AssemblyInfo.cs @@ -11,5 +11,5 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: Guid("fe5a979e-24c6-47dd-919f-81df6fb2e160")] -[assembly: AssemblyVersion("1.4.0")] -[assembly: AssemblyFileVersion("1.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.4.1")] +[assembly: AssemblyFileVersion("1.4.1")] \ No newline at end of file diff --git a/src/MessagePack.ReactiveProperty/_AssemblyInfo.cs b/src/MessagePack.ReactiveProperty/_AssemblyInfo.cs index b03a89c2..5c0e6460 100644 --- a/src/MessagePack.ReactiveProperty/_AssemblyInfo.cs +++ b/src/MessagePack.ReactiveProperty/_AssemblyInfo.cs @@ -11,5 +11,5 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: Guid("16b0640a-c86d-4f21-bf2f-45efc728ae96")] -[assembly: AssemblyVersion("1.4.0")] -[assembly: AssemblyFileVersion("1.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.4.1")] +[assembly: AssemblyFileVersion("1.4.1")] \ No newline at end of file diff --git a/src/MessagePack.UnityShims/_AssemblyInfo.cs b/src/MessagePack.UnityShims/_AssemblyInfo.cs index b6145c32..e3bc3074 100644 --- a/src/MessagePack.UnityShims/_AssemblyInfo.cs +++ b/src/MessagePack.UnityShims/_AssemblyInfo.cs @@ -11,5 +11,5 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: Guid("4b074f49-f7cb-4885-9a58-cc75a7d64b62")] -[assembly: AssemblyVersion("1.4.0")] -[assembly: AssemblyFileVersion("1.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.4.1")] +[assembly: AssemblyFileVersion("1.4.1")] \ No newline at end of file diff --git a/src/MessagePack/_AssemblyInfo.cs b/src/MessagePack/_AssemblyInfo.cs index d78ebd8c..d1d543d3 100644 --- a/src/MessagePack/_AssemblyInfo.cs +++ b/src/MessagePack/_AssemblyInfo.cs @@ -11,5 +11,5 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: Guid("b23e464e-0ac2-47c9-9520-ea98cbb99575")] -[assembly: AssemblyVersion("1.4.0")] -[assembly: AssemblyFileVersion("1.4.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.4.1")] +[assembly: AssemblyFileVersion("1.4.1")] \ No newline at end of file