Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Mar 13, 2017
1 parent 209f301 commit 353ab92
Show file tree
Hide file tree
Showing 25 changed files with 564 additions and 268 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,5 @@ src/MessagePack.UnityClient/Temp/*
nuget/mpc.exe
nuget/mpc.exe.config

nuget/tools/*
nuget/tools/*
nuget/unity/tools/*
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MessagePack for C#

MIT License

Copyright (c) 2017 Yoshifumi Kawai
Expand Down
452 changes: 348 additions & 104 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions nuget/MessagePack.AspNetCoreMvcFormatter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MessagePack.AspNetCoreMvcFormatter</id>
<version>0.8.5</version>
<version>1.0.1</version>
<title>ASP.NET Core MVC Input/Output MessagePack formatter</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
Expand All @@ -17,11 +17,11 @@
</frameworkAssemblies>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
<dependency id="Microsoft.AspNetCore.Mvc.Abstractions" version="1.1.2" />
</group>
<group targetFramework=".NETStandard1.4">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
<dependency id="Microsoft.AspNetCore.Mvc.Abstractions" version="1.1.2" />
</group>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions nuget/MessagePack.ImmutableCollection.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MessagePack.ImmutableCollection</id>
<version>0.8.5</version>
<version>1.0.1</version>
<title>MessagePack for C# Extension Support for ImmutableCollection</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
Expand All @@ -17,11 +17,11 @@
</frameworkAssemblies>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
<dependency id="System.Collections.Immutable" version="1.3.1" />
</group>
<group targetFramework=".NETStandard1.4">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
<dependency id="System.Collections.Immutable" version="1.3.1" />
</group>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions nuget/MessagePack.ReactiveProperty.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MessagePack.ReactiveProperty</id>
<version>0.8.5</version>
<version>1.0.1</version>
<title>MessagePack for C# Extension Support for ReactiveProperty</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
Expand All @@ -17,11 +17,11 @@
</frameworkAssemblies>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
<dependency id="ReactiveProperty" version="3.5.1" />
</group>
<group targetFramework=".NETStandard1.4">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
<dependency id="ReactiveProperty" version="3.5.1" />
</group>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions nuget/MessagePack.UnityShims.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MessagePack.UnityShims</id>
<version>0.8.5</version>
<version>1.0.1</version>
<title>MessagePack for C# Extension Support for Unity(add pseudo Vector type and fast Vectory[] extension formatter)</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
Expand All @@ -17,10 +17,10 @@
</frameworkAssemblies>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
</group>
<group targetFramework=".NETStandard1.4">
<dependency id="MessagePack" version="0.8.5" />
<dependency id="MessagePack" version="1.0.1" />
</group>
</dependencies>
</metadata>
Expand Down
4 changes: 2 additions & 2 deletions nuget/MessagePack.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MessagePack</id>
<version>0.8.5</version>
<version>1.0.1</version>
<title>MessagePack for C#</title>
<authors>neuecc</authors>
<owners>neuecc</owners>
<projectUrl>https://github.com/neuecc/MessagePack-CSharp/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin).</description>
<releaseNotes>for supports LZ4.</releaseNotes>
<releaseNotes>first stable version.</releaseNotes>
<tags>MsgPack, MessagePack, Serialization, Formatter, Serializer, Unity, Xamarin</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5" />
Expand Down
1 change: 1 addition & 0 deletions nuget/pack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ nuget pack MessagePack.nuspec
nuget pack MessagePack.ImmutableCollection.nuspec
nuget pack MessagePack.ReactiveProperty.nuspec
nuget pack MessagePack.UnityShims.nuspec
nuget pack MessagePack.AspNetCoreMvcFormatter.nuspec
nuget pack MessagePackAnalyzer.nuspec
9 changes: 5 additions & 4 deletions nuget/push.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nuget push MessagePack.0.8.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.ImmutableCollection.0.8.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.ReactiveProperty.0.8.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.UnityShims.0.8.5.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.1.0.1.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.ImmutableCollection.1.0.1.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.ReactiveProperty.1.0.1.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.UnityShims.1.0.1.nupkg -Source https://www.nuget.org/api/v2/package
nuget push MessagePack.MessagePack.AspNetCoreMvcFormatter.1.0.1.nupkg -Source https://www.nuget.org/api/v2/package
REM nuget push MessagePackAnalyzer.1.4.0.nupkg -Source https://www.nuget.org/api/v2/package
Binary file added nuget/unity/MessagePack.1.0.1.unitypackage
Binary file not shown.
62 changes: 0 additions & 62 deletions nuget/unity/tools/mpc.exe.config

This file was deleted.

2 changes: 1 addition & 1 deletion sandbox/PertNetFramework/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static void Main(string[] args)

var rand = new Random(100);
Person[] l = Enumerable.Range(1, 100)
.Select(x => new Person
.Select(x => new Person
{
Age = x,
FirstName = "Windows",
Expand Down
130 changes: 116 additions & 14 deletions sandbox/Sandbox/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,128 @@ public class Takox
public int tako { get; set; }
}

[MessagePackObject]
public class MyClass
{
// Key is serialization index, it is important for versioning.
[Key(0)]
public int Age { get; set; }

[Key(1)]
public string FirstName { get; set; }

[Key(2)]
public string LastName { get; set; }

// public members and does not serialize target, mark IgnoreMemberttribute
[IgnoreMember]
public string FullName { get { return FirstName + LastName; } }
}


[MessagePackObject(keyAsPropertyName: true)]
public class Sample1
{
[Key(0)]
public int Foo { get; set; }
[Key(1)]
public int Bar { get; set; }
}

[MessagePackObject]
public class Sample2
{
[Key("foo")]
public int Foo { get; set; }
[Key("bar")]
public int Bar { get; set; }
}


[MessagePackObject]
public class IntKeySample
{
[Key(3)]
public int A { get; set; }
[Key(10)]
public int B { get; set; }
}



public class ContractlessSample
{
public int MyProperty1 { get; set; }
public int MyProperty2 { get; set; }
}



[MessagePackObject]
public struct Point
{
[Key(0)]
public readonly int X;
[Key(1)]
public readonly int Y;

// can't find matched constructor parameter, parameterType mismatch. type:Point parameterIndex:0 paramterType:ValueTuple`2
public Point((int, int) p)
{
X = p.Item1;
Y = p.Item2;
}

[SerializationConstructor]
public Point(int x, int y)
{
this.X = x;
this.Y = y;
}
}

// mark inheritance types
[MessagePack.Union(0, typeof(FooClass))]
[MessagePack.Union(1, typeof(BarClass))]
public interface IUnionSample
{
}

[MessagePackObject]
public class FooClass : IUnionSample
{
[Key(0)]
public int XYZ { get; set; }
}

[MessagePackObject]
public class BarClass : IUnionSample
{
[Key(0)]
public string OPQ { get; set; }
}


class Program
{
static void Main(string[] args)
{
// composite same as StandardResolver
CompositeResolver.RegisterAndSetAsDefault(
MessagePack.Resolvers.BuiltinResolver.Instance,

// replace enumasstring resolver
MessagePack.Resolvers.DynamicEnumAsStringResolver.Instance,

MessagePack.Resolvers.DynamicGenericResolver.Instance,
MessagePack.Resolvers.DynamicUnionResolver.Instance,
MessagePack.Resolvers.DynamicObjectResolver.Instance,

// final fallback(last priority)
MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance
);

var bytes = new byte[0];
MessagePackBinary.WriteString(ref bytes, 0, "あいうえおあいうえおあいうえお");

var p = new Person
{
Age = 99999,
FirstName = "Windows",
LastName = "Server",
Sex = Sex.Male,
};
Person[] l = Enumerable.Range(1, 100).Select(x => new Person { Age = x, FirstName = "Windows", LastName = "Server", Sex = Sex.Female }).ToArray();

Benchmark(p);
Console.WriteLine();
Benchmark(l);

}

Expand Down Expand Up @@ -505,4 +606,5 @@ public IHogeMoge Deserialize(byte[] bytes, int offset, IFormatterResolver format

}
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ public bool IsClass
}
}

public bool IsPublic
{
get
{
return type.IsPublic;
}
}

public bool IsValueType
{
get
Expand Down

0 comments on commit 353ab92

Please sign in to comment.