Skip to content

Commit 208fd15

Browse files
committed
Change Unity3D default only depends to mscorlib.
The default settings of Unity editor uses ".NET 2.0 subset", and Stack<T>, Queue<T> and NameValueCollection are rarely used. So make default to only depending mscorlib.dll is reasonable.
1 parent 2e9800a commit 208fd15

33 files changed

+314
-268
lines changed

CHANGES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,11 @@ Release 0.6.0 Beta3 - 2015/06/14
276276

277277
BUG FIXES
278278
* Remove FILETIME dependency to avoid build error in Xamarin/Unity. Issue #87
279+
280+
Release 0.6 - 2015/06/29
281+
282+
BREAKING CHANGES / IMPROVEMENTS
283+
* Unity3D DLL now only depends on mscorlib.dll. This breaks compabitlity because the library cannot recognize Stack<T>, Queue<T> and NameValueCollection. If you want to these types support, use Unity3D.Full drop instead.
284+
285+
BUG FIXES
286+
* Fix Unity source code to avoid nullable equality operator. Issue #88

MsgPack.compats.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.UnitTest.Unity3D",
3737
EndProject
3838
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NUnitLite", "NUnitLite", "{767C2A1C-53F8-4048-BE02-CB4393B1CEB6}"
3939
EndProject
40-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnitLiteRunner", "..\..\Yusuke\Documents\git\msgpack-cli\test\NUnitLiteRunner\NUnitLiteRunner.csproj", "{12047296-B817-4C1A-B01B-5E619F72E407}"
40+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnitLiteRunner", "test\NUnitLiteRunner\NUnitLiteRunner.csproj", "{12047296-B817-4C1A-B01B-5E619F72E407}"
4141
EndProject
42-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunitlite-3.5", "..\..\Yusuke\Documents\git\msgpack-cli\test\NUnitLite\src\framework\nunitlite-3.5.csproj", "{43B24DC5-16D6-45EF-93F1-B021B785A892}"
42+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunitlite-3.5", "test\NUnitLite\src\framework\nunitlite-3.5.csproj", "{43B24DC5-16D6-45EF-93F1-B021B785A892}"
4343
EndProject
44-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.Unity3D.Micro", "src\MsgPack.Unity3D.Micro\MsgPack.Unity3D.Micro.csproj", "{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}"
44+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.Unity3D.Full", "src\MsgPack.Unity3D.Full\MsgPack.Unity3D.Full.csproj", "{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}"
4545
EndProject
4646
Global
4747
GlobalSection(SolutionConfigurationPlatforms) = preSolution

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,32 @@ See [wiki](https://github.com/msgpack/msgpack-cli/wiki)
6262

6363
msbuild MsgPack.sln
6464

65-
Or (for .NET 3.5 drops, Silverlight 4 drops, and Silverlight 5 drops):
65+
Or (for .NET 3.5 drops and Unity 3D drops):
6666

6767
msbuild MsgPack.compats.sln
6868

69+
Or (for Windows Runtime/Phone drops and Silverlight 5 drops):
70+
71+
msbuild MsgPack.Windows.sln
72+
73+
Or (for Xamarin drops, you must have Xamarin Business or upper license and Mac machine on the LAN to build on Windows):
74+
75+
msbuild MsgPack.Xamarin.sln
76+
6977
Or open one of above solution files in your IDE and run build command in it.
7078

7179
### For Mono
7280

7381
Open MsgPack.mono.sln with MonoDevelop and then click **Build** menu item.
7482
(Of cource, you can build via xbuild.)
7583

84+
### Own Unity 3D Build
85+
86+
First of all, there are binary drops on github release page, you should use it to save your time.
87+
Because we will not guarantee source code organization compatibilities, we might add/remove non-public types or members, which should break source code build.
88+
If you want to import sources, you must include just only described on MsgPack.Unity3D.csproj.
89+
If you want to use ".NET 2.0 Subset" settings, you must use just only described on MsgPack.Unity3D.CorLibOnly.csproj file, and define `CORLIB_ONLY` compiler constants.
90+
7691
## See also
7792

7893
* GitHub Page : http://cli.msgpack.org/

Sync.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,28 @@
5959
<Preserve Path="Properties\AssemblyInfo.cs" />
6060
</Project>
6161

62-
<Project Name="MsgPack.Unity3D" Base="MsgPack.Xamarin.iOS">
62+
<Project Name="MsgPack.Unity3D.Full" Base="MsgPack.Xamarin.iOS">
6363
<Preserve Path="Properties\AssemblyInfo.cs" />
6464
<Preserve Path="Serialization\AotHelper*.tt" />
6565
<Preserve Path="Serialization\AotHelper*.cs" />
6666
<Preserve Path="Serialization\NonGenericMessagePackSerializer.cs" />
6767
<Preserve Path="Serialization\TypedMessagePackSerializerWrapper`1.cs" />
6868
<Preserve Path="Serialization\EnumTypedMessagePackSerializerWrapper`1.cs" />
69+
<Preserve Path="CorLibOnlyHelper*.tt" />
70+
<Preserve Path="CorLibOnlyHelper*.cs" />
6971
<Exclude Path="Serialization\ReflectionSerializers\ReflectionTupleMessagePackSerializer`1.cs" />
7072
<Exclude Path="UnsafeNativeMethods.cs" />
7173
<Exclude Path="Validation.cs" />
7274
</Project>
7375

74-
<Project Name="MsgPack.Unity3D.Micro" Base="MsgPack.Unity3D">
76+
<Project Name="MsgPack.Unity3D" Base="MsgPack.Unity3D.Full">
7577
<Preserve Path="Properties\AssemblyInfo.cs" />
76-
<Preserve Path="MicroCorLibHelper*.tt" />
77-
<Preserve Path="MicroCorLibHelper*.cs" />
7878
<Exclude Path="Serialization\AotHelper*.tt" />
7979
<Exclude Path="Serialization\DefaultSerializers\System_Collections_Generic_Queue_1MessagePackSerializer`1.cs" />
8080
<Exclude Path="Serialization\DefaultSerializers\System_Collections_Generic_Stack_1MessagePackSerializer`1.cs" />
8181
<Exclude Path="Serialization\DefaultSerializers\System_Collections_Specialized_NameValueCollectionMessagePackSerializer.cs" />
8282
<Exclude Path="Serialization\DefaultSerializers\System_UriMessagePackSerializer.cs" />
83+
<Exclude Path="CorLibOnlyHelper*.tt" />
8384
</Project>
8485

8586
<Project Name="MsgPack.WinRT.Portable" Base="MsgPack">

src/MsgPack.Unity3D.Micro/MicroCorLibHelper.cs renamed to src/MsgPack.Unity3D.Full/CorLibOnlyHelper.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226
using System.Collections.Generic;
2327

2428
namespace MsgPack
2529
{
26-
#if CORLIB_ONLY
30+
#if UNITY && !MSGPACK_UNITY_FULL
2731
internal sealed class BooleanStack
2832
{
2933
private readonly List<Boolean> _list;
@@ -82,5 +86,5 @@ public Int64 Pop()
8286
}
8387
}
8488

85-
#endif // CORLIB_ONLY
89+
#endif // UNITY && !MSGPACK_UNITY_FULL
8690
}

src/MsgPack.Unity3D.Micro/MicroCorLibHelper.tt renamed to src/MsgPack.Unity3D.Full/CorLibOnlyHelper.tt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@
2424
//
2525
#endregion -- License Terms --
2626

27+
#if UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
28+
#define UNITY
29+
#endif
30+
2731
using System;
2832
using System.Collections.Generic;
2933

3034
namespace MsgPack
3135
{
32-
#if CORLIB_ONLY
36+
#if UNITY && !MSGPACK_UNITY_FULL
3337
<#
3438
foreach ( var itemType in new[] { typeof( bool ), typeof( long ) } )
3539
{
@@ -66,5 +70,5 @@ foreach ( var itemType in new[] { typeof( bool ), typeof( long ) } )
6670
<#
6771
}
6872
#>
69-
#endif // CORLIB_ONLY
73+
#endif // UNITY && !MSGPACK_UNITY_FULL
7074
}

src/MsgPack.Unity3D.Micro/MsgPack.Unity3D.Micro.csproj renamed to src/MsgPack.Unity3D.Full/MsgPack.Unity3D.Full.csproj

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<DebugType>full</DebugType>
1818
<Optimize>false</Optimize>
1919
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>TRACE;DEBUG;UNITY_IPHONE;CORLIB_ONLY;CODE_ANALYSIS</DefineConstants>
20+
<DefineConstants>TRACE;DEBUG;UNITY_IPHONE;MSGPACK_UNITY_FULL;CODE_ANALYSIS</DefineConstants>
2121
<ErrorReport>prompt</ErrorReport>
2222
<WarningLevel>4</WarningLevel>
2323
<DocumentationFile>bin\Debug\MsgPack.XML</DocumentationFile>
@@ -26,11 +26,11 @@
2626
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2727
<DebugType>pdbonly</DebugType>
2828
<Optimize>true</Optimize>
29-
<OutputPath>..\..\MsgPack-CLI\unity3d-micro\</OutputPath>
30-
<DefineConstants>TRACE;UNITY_IPHONE;CORLIB_ONLY</DefineConstants>
29+
<OutputPath>..\..\MsgPack-CLI\unity3d-full\</OutputPath>
30+
<DefineConstants>TRACE;UNITY_IPHONE;MSGPACK_UNITY_FULL</DefineConstants>
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
33-
<DocumentationFile>..\..\MsgPack-CLI\unity3d-micro\MsgPack.XML</DocumentationFile>
33+
<DocumentationFile>..\..\MsgPack-CLI\unity3d-full\MsgPack.XML</DocumentationFile>
3434
<NoWarn>3001,3002</NoWarn>
3535
</PropertyGroup>
3636
<ItemGroup>
@@ -40,21 +40,6 @@
4040
<Compile Include="..\CommonAssemblyInfo.Pack.cs">
4141
<Link>Properties\CommonAssemblyInfo.Pack.cs</Link>
4242
</Compile>
43-
<Compile Include="..\MsgPack.Unity3D\Serialization\AotHelper.cs">
44-
<Link>Serialization\AotHelper.cs</Link>
45-
</Compile>
46-
<Compile Include="..\MsgPack.Unity3D\Serialization\AotHelper.EqualityComparers.cs">
47-
<Link>Serialization\AotHelper.EqualityComparers.cs</Link>
48-
</Compile>
49-
<Compile Include="..\MsgPack.Unity3D\Serialization\EnumTypedMessagePackSerializerWrapper`1.cs">
50-
<Link>Serialization\EnumTypedMessagePackSerializerWrapper`1.cs</Link>
51-
</Compile>
52-
<Compile Include="..\MsgPack.Unity3D\Serialization\NonGenericMessagePackSerializer.cs">
53-
<Link>Serialization\NonGenericMessagePackSerializer.cs</Link>
54-
</Compile>
55-
<Compile Include="..\MsgPack.Unity3D\Serialization\TypedMessagePackSerializerWrapper`1.cs">
56-
<Link>Serialization\TypedMessagePackSerializerWrapper`1.cs</Link>
57-
</Compile>
5843
<Compile Include="..\MsgPack.Xamarin.iOS\MPContract.cs">
5944
<Link>MPContract.cs</Link>
6045
</Compile>
@@ -325,9 +310,18 @@
325310
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Collections_Generic_List_1MessagePackSerializer`1.cs">
326311
<Link>Serialization\DefaultSerializers\System_Collections_Generic_List_1MessagePackSerializer`1.cs</Link>
327312
</Compile>
313+
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Collections_Generic_Queue_1MessagePackSerializer`1.cs">
314+
<Link>Serialization\DefaultSerializers\System_Collections_Generic_Queue_1MessagePackSerializer`1.cs</Link>
315+
</Compile>
316+
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Collections_Generic_Stack_1MessagePackSerializer`1.cs">
317+
<Link>Serialization\DefaultSerializers\System_Collections_Generic_Stack_1MessagePackSerializer`1.cs</Link>
318+
</Compile>
328319
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Collections_QueueMessagePackSerializer.cs">
329320
<Link>Serialization\DefaultSerializers\System_Collections_QueueMessagePackSerializer.cs</Link>
330321
</Compile>
322+
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Collections_Specialized_NameValueCollectionMessagePackSerializer.cs">
323+
<Link>Serialization\DefaultSerializers\System_Collections_Specialized_NameValueCollectionMessagePackSerializer.cs</Link>
324+
</Compile>
331325
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Collections_StackMessagePackSerializer.cs">
332326
<Link>Serialization\DefaultSerializers\System_Collections_StackMessagePackSerializer.cs</Link>
333327
</Compile>
@@ -346,6 +340,9 @@
346340
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_Text_StringBuilderMessagePackSerializer.cs">
347341
<Link>Serialization\DefaultSerializers\System_Text_StringBuilderMessagePackSerializer.cs</Link>
348342
</Compile>
343+
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_UriMessagePackSerializer.cs">
344+
<Link>Serialization\DefaultSerializers\System_UriMessagePackSerializer.cs</Link>
345+
</Compile>
349346
<Compile Include="..\MsgPack\Serialization\DefaultSerializers\System_VersionMessagePackSerializer.cs">
350347
<Link>Serialization\DefaultSerializers\System_VersionMessagePackSerializer.cs</Link>
351348
</Compile>
@@ -628,16 +625,33 @@
628625
<Compile Include="..\MsgPack\UnpackingStreamReader.cs">
629626
<Link>UnpackingStreamReader.cs</Link>
630627
</Compile>
631-
<Compile Include="MicroCorLibHelper.cs" />
628+
<Compile Include="CorLibOnlyHelper.cs">
629+
<AutoGen>True</AutoGen>
630+
<DesignTime>True</DesignTime>
631+
<DependentUpon>CorLibOnlyHelper.tt</DependentUpon>
632+
</Compile>
632633
<Compile Include="Properties\AssemblyInfo.cs" />
634+
<Compile Include="Serialization\AotHelper.cs" />
635+
<Compile Include="Serialization\AotHelper.EqualityComparers.cs">
636+
<AutoGen>True</AutoGen>
637+
<DesignTime>True</DesignTime>
638+
<DependentUpon>AotHelper.EqualityComparers.tt</DependentUpon>
639+
</Compile>
640+
<Compile Include="Serialization\EnumTypedMessagePackSerializerWrapper`1.cs" />
641+
<Compile Include="Serialization\NonGenericMessagePackSerializer.cs" />
642+
<Compile Include="Serialization\TypedMessagePackSerializerWrapper`1.cs" />
633643
</ItemGroup>
634644
<ItemGroup>
635645
<None Include="..\MsgPack\remarks.xml">
636646
<Link>remarks.xml</Link>
637647
</None>
638-
<None Include="MicroCorLibHelper.tt">
648+
<None Include="CorLibOnlyHelper.tt">
639649
<Generator>TextTemplatingFileGenerator</Generator>
640-
<LastGenOutput>MicroCorLibHelper.cs</LastGenOutput>
650+
<LastGenOutput>CorLibOnlyHelper.cs</LastGenOutput>
651+
</None>
652+
<None Include="Serialization\AotHelper.EqualityComparers.tt">
653+
<Generator>TextTemplatingFileGenerator</Generator>
654+
<LastGenOutput>AotHelper.EqualityComparers.cs</LastGenOutput>
641655
</None>
642656
</ItemGroup>
643657
<ItemGroup>
@@ -648,6 +662,9 @@
648662
<ItemGroup>
649663
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
650664
</ItemGroup>
665+
<ItemGroup>
666+
<Reference Include="System" />
667+
</ItemGroup>
651668
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
652669
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
653670
Other similar extension points exist, see Microsoft.Common.targets.

src/MsgPack.Unity3D.Micro/Properties/AssemblyInfo.cs renamed to src/MsgPack.Unity3D.Full/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
using System.Security;
2424

2525
[assembly: AssemblyTitle( "MessagePack for CLI(.NET/Mono)" )]
26-
[assembly: AssemblyDescription( "MessagePack for CLI(.NET/Mono) packing/unpacking library for Unity3D stripping mode." )]
27-
[assembly: AssemblyCopyright( "Copyright © FUJIWARA, Yusuke 2010-2014" )]
26+
[assembly: AssemblyDescription( "MessagePack for CLI(.NET/Mono) packing/unpacking library for Unity3D with Full .NET 2.0 mode." )]
27+
[assembly: AssemblyCopyright( "Copyright © FUJIWARA, Yusuke 2010-2015" )]
2828

2929

3030
[assembly: AssemblyFileVersion( "0.6.1990.830" )]

0 commit comments

Comments
 (0)