Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 294d6d3

Browse files
committed
Relax dynamic CoreCLR #defs to just SL5 && CORECLR
1 parent ada5503 commit 294d6d3

File tree

8 files changed

+50
-20
lines changed

8 files changed

+50
-20
lines changed

src/ServiceStack.Text/Pcl.Dynamic.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//Copyright (c) Service Stack LLC. All Rights Reserved.
22
//License: https://raw.github.com/ServiceStack/ServiceStack/master/license.txt
33

4-
#if !PCL && FALSE
4+
#if !PCL
55

66
using System;
77
using System.Collections.Generic;
@@ -87,6 +87,9 @@ private static int VerifyAndGetStartIndex(string value, Type createMapType)
8787
}
8888
}
8989

90+
//TODO: Workout how to fix broken CoreCLR SL5 build that uses dynamic
91+
#if !(SL5 && CORECLR)
92+
9093
public class DynamicJson : DynamicObject
9194
{
9295
private readonly IDictionary<string, object> _hash = new Dictionary<string, object>();
@@ -179,6 +182,7 @@ internal static string Underscored(IEnumerable<char> pascalCase)
179182
return sb.ToString().ToLowerInvariant();
180183
}
181184
}
185+
#endif
182186
}
183187

184188
#endif

src/ServiceStack.Text/PclExport.Net40.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public override ParseStringDelegate GetSpecializedCollectionParseMethod<TSeriali
456456

457457
public override ParseStringDelegate GetJsReaderParseMethod<TSerializer>(Type type)
458458
{
459-
#if !__IOS__ && FALSE
459+
#if !__IOS__
460460
if (type.AssignableFrom(typeof(System.Dynamic.IDynamicMetaObjectProvider)) ||
461461
type.HasInterface(typeof(System.Dynamic.IDynamicMetaObjectProvider)))
462462
{

src/ServiceStack.Text/PclExport.Sl5.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public override Assembly LoadAssembly(string assemblyPath)
4444

4545
public override Assembly[] GetAllAssemblies()
4646
{
47-
//TODO: Get dynamic working in sl5 builds
48-
#if FALSE
47+
//TODO: Workout how to fix broken CoreCLR SL5 build that uses dynamic
48+
#if !(SL5 && CORECLR)
4949
return ((dynamic)AppDomain.CurrentDomain).GetAssemblies() as Assembly[];
5050
#else
5151
return new Assembly[0];

src/ServiceStack.Text/PclExport.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,14 +396,12 @@ public virtual ParseStringDelegate GetSpecializedCollectionParseMethod<TSerializ
396396
public virtual ParseStringDelegate GetJsReaderParseMethod<TSerializer>(Type type)
397397
where TSerializer : ITypeSerializer
398398
{
399-
#if !PCL && FALSE
400399
if (type.AssignableFrom(typeof(System.Dynamic.IDynamicMetaObjectProvider)) ||
401400
type.HasInterface(typeof(System.Dynamic.IDynamicMetaObjectProvider)))
402401
{
403-
return DeserializeDynamic<TSerializer>.Parse;
402+
return DeserializeDynamic<TSerializer>.Parse;
404403
}
405-
#endif
406-
return null;
404+
return null;
407405
}
408406

409407
public virtual XmlSerializer NewXmlSerializer()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.22823.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ServiceStack.Text", "ServiceStack.Text.xproj", "{8F56DF61-B041-4B95-B658-EB51EBEF4EF6}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{8F56DF61-B041-4B95-B658-EB51EBEF4EF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{8F56DF61-B041-4B95-B658-EB51EBEF4EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{8F56DF61-B041-4B95-B658-EB51EBEF4EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{8F56DF61-B041-4B95-B658-EB51EBEF4EF6}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

src/ServiceStack.Text/ServiceStack.Text.xproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2525
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
2626
</PropertyGroup>
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
28+
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
29+
</PropertyGroup>
2730
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
2831
</Project>

src/ServiceStack.Text/project.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44
"frameworks": {
55

6-
"net45+win+wpa81+MonoAndroid10+Xamarin.iOS10+MonoTouch10": {
6+
"net45+sl5+MonoAndroid10+Xamarin.iOS10+MonoTouch10": {
77
"frameworkAssemblies": {
8-
"Microsoft.CSharp": "",
98
"System.Core": "",
109
"System.Collections": "",
11-
"System.Runtime": "",
1210
"System.Linq": "",
1311
"System.Linq.Expressions": "",
1412
"System.Linq.Queryable": "",
@@ -17,20 +15,26 @@
1715
"System.Reflection.Extensions": "",
1816
"System.Diagnostics.Debug": "",
1917
"System.ObjectModel": "",
18+
"System.Threading": "",
19+
"System.Runtime": "",
2020
"System.Runtime.Extensions": "",
21-
"System.Threading": ""
22-
}
21+
"System.Runtime.Serialization.Primitives": "",
22+
"System.Runtime.Serialization.Json": "",
23+
"System.Runtime.Serialization.Xml": "",
24+
"System.Net.Requests": "",
25+
"System.Net.Http": ""
26+
},
27+
"compilationOptions": { "define": [ "PCL", "CORECLR" ] }
2328
},
2429
"net45": {
2530
"frameworkAssemblies": {
26-
"Microsoft.CSharp": "",
2731
"System.Core": "",
2832
"System.Runtime.Serialization": "",
2933
"System.Xml": "",
3034
"System.Data.Linq": "",
3135
"System.Configuration": ""
3236
},
33-
"compilationOptions": { "define": [ "NET45" ] }
37+
"compilationOptions": { "define": [ "NET45", "CORECLR" ] }
3438
},
3539
"sl5": {
3640
"frameworkAssemblies": {
@@ -41,17 +45,18 @@
4145
"System.Net": "",
4246
"System.Xml": "",
4347
"System.Windows": ""
44-
}
48+
},
49+
"compilationOptions": { "define": [ "SL5", "CORECLR" ] }
4550
},
4651
"dnx451": {
4752
"frameworkAssemblies": {
4853
"System.Core": "",
49-
"Microsoft.CSharp": "",
5054
"System.Runtime.Serialization": "",
5155
"System.Xml": "",
5256
"System.Data.Linq": "",
5357
"System.Configuration": ""
54-
}
58+
},
59+
"compilationOptions": { "define": [ "DNX451", "CORECLR" ] }
5560
}
5661
}
5762
}

src/ServiceStack.Text/project.lock.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"projectFileDependencyGroups": {
55
"": [],
66
".NETFramework,Version=v4.5": [
7-
"framework/Microsoft.CSharp ",
87
"framework/System.Core ",
98
"framework/System.Runtime.Serialization ",
109
"framework/System.Xml ",
@@ -22,7 +21,6 @@
2221
],
2322
"DNX,Version=v4.5.1": [
2423
"framework/System.Core ",
25-
"framework/Microsoft.CSharp ",
2624
"framework/System.Runtime.Serialization ",
2725
"framework/System.Xml ",
2826
"framework/System.Data.Linq ",

0 commit comments

Comments
 (0)