Skip to content

Commit 495add6

Browse files
committed
Add experimental depending only mscorlib assembly (Unity3D.Micro). Related to Issue #72.
1 parent 5cba15e commit 495add6

29 files changed

+1201
-32
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ Release 0.6.0 Beta2 - 2015/05/24
261261

262262
NEW FEATURE
263263
* New utility method of SerializationContext to switch back the behavior to previous version's one.
264+
* Add corlib only build (MsgPack.Unity3D.Micro). This build only depends mscorlib. This feature is experimental. Related to Issue #72.
264265

265266
IMPROVEMENTS
266267
* Add many workarounds for AOT issues of Mono on iOS (in particular, Unity).

MsgPack.compats.sln

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnitLiteRunner", "..\..\Yu
4141
EndProject
4242
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}"
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}"
45+
EndProject
4446
Global
4547
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4648
CodeAnalysis|Any CPU = CodeAnalysis|Any CPU
@@ -299,6 +301,36 @@ Global
299301
{43B24DC5-16D6-45EF-93F1-B021B785A892}.Release|ARM.ActiveCfg = Release|Any CPU
300302
{43B24DC5-16D6-45EF-93F1-B021B785A892}.Release|x64.ActiveCfg = Release|Any CPU
301303
{43B24DC5-16D6-45EF-93F1-B021B785A892}.Release|x86.ActiveCfg = Release|Any CPU
304+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CodeAnalysis|Any CPU.ActiveCfg = Release|Any CPU
305+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CodeAnalysis|Any CPU.Build.0 = Release|Any CPU
306+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CodeAnalysis|ARM.ActiveCfg = Release|Any CPU
307+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CodeAnalysis|x64.ActiveCfg = Release|Any CPU
308+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CodeAnalysis|x86.ActiveCfg = Release|Any CPU
309+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CoreProfile|Any CPU.ActiveCfg = Release|Any CPU
310+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CoreProfile|Any CPU.Build.0 = Release|Any CPU
311+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CoreProfile|ARM.ActiveCfg = Release|Any CPU
312+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CoreProfile|x64.ActiveCfg = Release|Any CPU
313+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.CoreProfile|x86.ActiveCfg = Release|Any CPU
314+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
315+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Debug|Any CPU.Build.0 = Debug|Any CPU
316+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Debug|ARM.ActiveCfg = Debug|Any CPU
317+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Debug|x64.ActiveCfg = Debug|Any CPU
318+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Debug|x86.ActiveCfg = Debug|Any CPU
319+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Instrument|Any CPU.ActiveCfg = Release|Any CPU
320+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Instrument|Any CPU.Build.0 = Release|Any CPU
321+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Instrument|ARM.ActiveCfg = Release|Any CPU
322+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Instrument|x64.ActiveCfg = Release|Any CPU
323+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Instrument|x86.ActiveCfg = Release|Any CPU
324+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.PerformanceTest|Any CPU.ActiveCfg = Release|Any CPU
325+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.PerformanceTest|Any CPU.Build.0 = Release|Any CPU
326+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.PerformanceTest|ARM.ActiveCfg = Release|Any CPU
327+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.PerformanceTest|x64.ActiveCfg = Release|Any CPU
328+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.PerformanceTest|x86.ActiveCfg = Release|Any CPU
329+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Release|Any CPU.ActiveCfg = Release|Any CPU
330+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Release|Any CPU.Build.0 = Release|Any CPU
331+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Release|ARM.ActiveCfg = Release|Any CPU
332+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Release|x64.ActiveCfg = Release|Any CPU
333+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121}.Release|x86.ActiveCfg = Release|Any CPU
302334
EndGlobalSection
303335
GlobalSection(SolutionProperties) = preSolution
304336
HideSolutionNode = FALSE
@@ -315,5 +347,6 @@ Global
315347
{767C2A1C-53F8-4048-BE02-CB4393B1CEB6} = {87A17015-9338-431E-B338-57BDA03984C1}
316348
{12047296-B817-4C1A-B01B-5E619F72E407} = {767C2A1C-53F8-4048-BE02-CB4393B1CEB6}
317349
{43B24DC5-16D6-45EF-93F1-B021B785A892} = {767C2A1C-53F8-4048-BE02-CB4393B1CEB6}
350+
{B752BA0A-72A8-4EE8-AF44-D4F5A55A6121} = {936467D2-1DD3-4243-BBB4-FCCB2CA1E3AC}
318351
EndGlobalSection
319352
EndGlobal

Sync.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@
6868
<Exclude Path="Validation.cs" />
6969
</Project>
7070

71+
<Project Name="MsgPack.Unity3D.Micro" Base="MsgPack.Unity3D">
72+
<Preserve Path="Properties\AssemblyInfo.cs" />
73+
<Preserve Path="MicroCorLibHelper*.tt" />
74+
<Preserve Path="MicroCorLibHelper*.cs" />
75+
<Exclude Path="Serialization\AotHelper*.tt" />
76+
<Exclude Path="Serialization\DefaultSerializers\System_Collections_Generic_Queue_1MessagePackSerializer`1.cs" />
77+
<Exclude Path="Serialization\DefaultSerializers\System_Collections_Generic_Stack_1MessagePackSerializer`1.cs" />
78+
<Exclude Path="Serialization\DefaultSerializers\System_Collections_Specialized_NameValueCollectionMessagePackSerializer.cs" />
79+
<Exclude Path="Serialization\DefaultSerializers\System_UriMessagePackSerializer.cs" />
80+
</Project>
81+
7182
<Project Name="MsgPack.WinRT.Portable" Base="MsgPack">
7283
<Preserve Path="Properties\AssemblyInfo.cs" />
7384
<Exclude File="*.tt" />
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#region -- License Terms --
2+
//
3+
// MessagePack for CLI
4+
//
5+
// Copyright (C) 2015 FUJIWARA, Yusuke
6+
//
7+
// Licensed under the Apache License, Version 2.0 (the "License");
8+
// you may not use this file except in compliance with the License.
9+
// You may obtain a copy of the License at
10+
//
11+
// http://www.apache.org/licenses/LICENSE-2.0
12+
//
13+
// Unless required by applicable law or agreed to in writing, software
14+
// distributed under the License is distributed on an "AS IS" BASIS,
15+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
// See the License for the specific language governing permissions and
17+
// limitations under the License.
18+
//
19+
#endregion -- License Terms --
20+
21+
using System;
22+
using System.Collections.Generic;
23+
24+
namespace MsgPack
25+
{
26+
#if CORLIB_ONLY
27+
internal sealed class BooleanStack
28+
{
29+
private readonly List<Boolean> _list;
30+
31+
public int Count { get { return this._list.Count; } }
32+
33+
public BooleanStack( int initialCapacity )
34+
{
35+
this._list = new List<Boolean>( initialCapacity );
36+
}
37+
38+
public void Push( Boolean value )
39+
{
40+
this._list.Add( value );
41+
}
42+
43+
public Boolean Peek()
44+
{
45+
return this._list[ this._list.Count - 1 ];
46+
}
47+
48+
public Boolean Pop()
49+
{
50+
var result = this.Peek();
51+
this._list.RemoveAt( this._list.Count - 1 );
52+
return result;
53+
}
54+
}
55+
56+
internal sealed class Int64Stack
57+
{
58+
private readonly List<Int64> _list;
59+
60+
public int Count { get { return this._list.Count; } }
61+
62+
public Int64Stack( int initialCapacity )
63+
{
64+
this._list = new List<Int64>( initialCapacity );
65+
}
66+
67+
public void Push( Int64 value )
68+
{
69+
this._list.Add( value );
70+
}
71+
72+
public Int64 Peek()
73+
{
74+
return this._list[ this._list.Count - 1 ];
75+
}
76+
77+
public Int64 Pop()
78+
{
79+
var result = this.Peek();
80+
this._list.RemoveAt( this._list.Count - 1 );
81+
return result;
82+
}
83+
}
84+
85+
#endif // CORLIB_ONLY
86+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<#@ template debug="false" hostspecific="false" language="C#" #>
2+
<#@ assembly name="System.Core" #>
3+
<#@ import namespace="System.Linq" #>
4+
<#@ import namespace="System.Text" #>
5+
<#@ import namespace="System.Collections.Generic" #>
6+
<#@ output extension=".cs" #>
7+
#region -- License Terms --
8+
//
9+
// MessagePack for CLI
10+
//
11+
// Copyright (C) 2015 FUJIWARA, Yusuke
12+
//
13+
// Licensed under the Apache License, Version 2.0 (the "License");
14+
// you may not use this file except in compliance with the License.
15+
// You may obtain a copy of the License at
16+
//
17+
// http://www.apache.org/licenses/LICENSE-2.0
18+
//
19+
// Unless required by applicable law or agreed to in writing, software
20+
// distributed under the License is distributed on an "AS IS" BASIS,
21+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
// See the License for the specific language governing permissions and
23+
// limitations under the License.
24+
//
25+
#endregion -- License Terms --
26+
27+
using System;
28+
using System.Collections.Generic;
29+
30+
namespace MsgPack
31+
{
32+
#if CORLIB_ONLY
33+
<#
34+
foreach ( var itemType in new[] { typeof( bool ), typeof( long ) } )
35+
{
36+
#>
37+
internal sealed class <#= itemType.Name #>Stack
38+
{
39+
private readonly List<<#= itemType.Name #>> _list;
40+
41+
public int Count { get { return this._list.Count; } }
42+
43+
public <#= itemType.Name #>Stack( int initialCapacity )
44+
{
45+
this._list = new List<<#= itemType.Name #>>( initialCapacity );
46+
}
47+
48+
public void Push( <#= itemType.Name #> value )
49+
{
50+
this._list.Add( value );
51+
}
52+
53+
public <#= itemType.Name #> Peek()
54+
{
55+
return this._list[ this._list.Count - 1 ];
56+
}
57+
58+
public <#= itemType.Name #> Pop()
59+
{
60+
var result = this.Peek();
61+
this._list.RemoveAt( this._list.Count - 1 );
62+
return result;
63+
}
64+
}
65+
66+
<#
67+
}
68+
#>
69+
#endif // CORLIB_ONLY
70+
}

0 commit comments

Comments
 (0)