Skip to content

Commit cbcd442

Browse files
committed
Make ServiceStack.Text compile in MonoTouch
1 parent 6ebd159 commit cbcd442

8 files changed

Lines changed: 322 additions & 4 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("ServiceStack.Text.MonoTouch")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("ServiceStack.Text.MonoTouch")]
13+
[assembly: AssemblyCopyright("Copyright © 2012")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("8af04880-eee5-41ff-b962-7a7fcefa3ebf")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{9A3F2C71-F6BE-491F-86F7-01708C2263BE}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>ServiceStack.Text.MonoTouch</RootNamespace>
12+
<AssemblyName>ServiceStack.Text.MonoTouch</AssemblyName>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>TRACE;DEBUG;MONOTOUCH</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System" />
35+
<Reference Include="System.Core" />
36+
<Reference Include="System.Runtime.Serialization" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Xml" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="..\ServiceStack.Text\AssemblyUtils.cs">
45+
<Link>AssemblyUtils.cs</Link>
46+
</Compile>
47+
<Compile Include="..\ServiceStack.Text\Common\DateTimeSerializer.cs">
48+
<Link>Common\DateTimeSerializer.cs</Link>
49+
</Compile>
50+
<Compile Include="..\ServiceStack.Text\Common\DeserializeArray.cs">
51+
<Link>Common\DeserializeArray.cs</Link>
52+
</Compile>
53+
<Compile Include="..\ServiceStack.Text\Common\DeserializeBuiltin.cs">
54+
<Link>Common\DeserializeBuiltin.cs</Link>
55+
</Compile>
56+
<Compile Include="..\ServiceStack.Text\Common\DeserializeCollection.cs">
57+
<Link>Common\DeserializeCollection.cs</Link>
58+
</Compile>
59+
<Compile Include="..\ServiceStack.Text\Common\DeserializeDictionary.cs">
60+
<Link>Common\DeserializeDictionary.cs</Link>
61+
</Compile>
62+
<Compile Include="..\ServiceStack.Text\Common\DeserializeListWithElements.cs">
63+
<Link>Common\DeserializeListWithElements.cs</Link>
64+
</Compile>
65+
<Compile Include="..\ServiceStack.Text\Common\DeserializeSpecializedCollections.cs">
66+
<Link>Common\DeserializeSpecializedCollections.cs</Link>
67+
</Compile>
68+
<Compile Include="..\ServiceStack.Text\Common\DeserializeType.cs">
69+
<Link>Common\DeserializeType.cs</Link>
70+
</Compile>
71+
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeRef.cs">
72+
<Link>Common\DeserializeTypeRef.cs</Link>
73+
</Compile>
74+
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeRefJson.cs">
75+
<Link>Common\DeserializeTypeRefJson.cs</Link>
76+
</Compile>
77+
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeRefJsv.cs">
78+
<Link>Common\DeserializeTypeRefJsv.cs</Link>
79+
</Compile>
80+
<Compile Include="..\ServiceStack.Text\Common\DeserializeTypeUtils.cs">
81+
<Link>Common\DeserializeTypeUtils.cs</Link>
82+
</Compile>
83+
<Compile Include="..\ServiceStack.Text\Common\ITypeSerializer.cs">
84+
<Link>Common\ITypeSerializer.cs</Link>
85+
</Compile>
86+
<Compile Include="..\ServiceStack.Text\Common\JsDelegates.cs">
87+
<Link>Common\JsDelegates.cs</Link>
88+
</Compile>
89+
<Compile Include="..\ServiceStack.Text\Common\JsReader.cs">
90+
<Link>Common\JsReader.cs</Link>
91+
</Compile>
92+
<Compile Include="..\ServiceStack.Text\Common\JsState.cs">
93+
<Link>Common\JsState.cs</Link>
94+
</Compile>
95+
<Compile Include="..\ServiceStack.Text\Common\JsWriter.cs">
96+
<Link>Common\JsWriter.cs</Link>
97+
</Compile>
98+
<Compile Include="..\ServiceStack.Text\Common\ParseUtils.cs">
99+
<Link>Common\ParseUtils.cs</Link>
100+
</Compile>
101+
<Compile Include="..\ServiceStack.Text\Common\StaticParseMethod.cs">
102+
<Link>Common\StaticParseMethod.cs</Link>
103+
</Compile>
104+
<Compile Include="..\ServiceStack.Text\Common\WriteDictionary.cs">
105+
<Link>Common\WriteDictionary.cs</Link>
106+
</Compile>
107+
<Compile Include="..\ServiceStack.Text\Common\WriteLists.cs">
108+
<Link>Common\WriteLists.cs</Link>
109+
</Compile>
110+
<Compile Include="..\ServiceStack.Text\Common\WriteType.cs">
111+
<Link>Common\WriteType.cs</Link>
112+
</Compile>
113+
<Compile Include="..\ServiceStack.Text\Controller\CommandProcessor.cs">
114+
<Link>Controller\CommandProcessor.cs</Link>
115+
</Compile>
116+
<Compile Include="..\ServiceStack.Text\Controller\PathInfo.cs">
117+
<Link>Controller\PathInfo.cs</Link>
118+
</Compile>
119+
<Compile Include="..\ServiceStack.Text\CsvConfig.cs">
120+
<Link>CsvConfig.cs</Link>
121+
</Compile>
122+
<Compile Include="..\ServiceStack.Text\CsvSerializer.cs">
123+
<Link>CsvSerializer.cs</Link>
124+
</Compile>
125+
<Compile Include="..\ServiceStack.Text\CsvStreamExtensions.cs">
126+
<Link>CsvStreamExtensions.cs</Link>
127+
</Compile>
128+
<Compile Include="..\ServiceStack.Text\CsvWriter.cs">
129+
<Link>CsvWriter.cs</Link>
130+
</Compile>
131+
<Compile Include="..\ServiceStack.Text\DateTimeExtensions.cs">
132+
<Link>DateTimeExtensions.cs</Link>
133+
</Compile>
134+
<Compile Include="..\ServiceStack.Text\Env.cs">
135+
<Link>Env.cs</Link>
136+
</Compile>
137+
<Compile Include="..\ServiceStack.Text\ITracer.cs">
138+
<Link>ITracer.cs</Link>
139+
</Compile>
140+
<Compile Include="..\ServiceStack.Text\ITypeSerializer.Generic.cs">
141+
<Link>ITypeSerializer.Generic.cs</Link>
142+
</Compile>
143+
<Compile Include="..\ServiceStack.Text\JsConfig.cs">
144+
<Link>JsConfig.cs</Link>
145+
</Compile>
146+
<Compile Include="..\ServiceStack.Text\JsonObject.cs">
147+
<Link>JsonObject.cs</Link>
148+
</Compile>
149+
<Compile Include="..\ServiceStack.Text\JsonSerializer.cs">
150+
<Link>JsonSerializer.cs</Link>
151+
</Compile>
152+
<Compile Include="..\ServiceStack.Text\JsonSerializer.Generic.cs">
153+
<Link>JsonSerializer.Generic.cs</Link>
154+
</Compile>
155+
<Compile Include="..\ServiceStack.Text\Json\JsonReader.Generic.cs">
156+
<Link>Json\JsonReader.Generic.cs</Link>
157+
</Compile>
158+
<Compile Include="..\ServiceStack.Text\Json\JsonTypeSerializer.cs">
159+
<Link>Json\JsonTypeSerializer.cs</Link>
160+
</Compile>
161+
<Compile Include="..\ServiceStack.Text\Json\JsonUtils.cs">
162+
<Link>Json\JsonUtils.cs</Link>
163+
</Compile>
164+
<Compile Include="..\ServiceStack.Text\Json\JsonWriter.Generic.cs">
165+
<Link>Json\JsonWriter.Generic.cs</Link>
166+
</Compile>
167+
<Compile Include="..\ServiceStack.Text\JsvFormatter.cs">
168+
<Link>JsvFormatter.cs</Link>
169+
</Compile>
170+
<Compile Include="..\ServiceStack.Text\Jsv\JsvDeserializeType.cs">
171+
<Link>Jsv\JsvDeserializeType.cs</Link>
172+
</Compile>
173+
<Compile Include="..\ServiceStack.Text\Jsv\JsvReader.Generic.cs">
174+
<Link>Jsv\JsvReader.Generic.cs</Link>
175+
</Compile>
176+
<Compile Include="..\ServiceStack.Text\Jsv\JsvSerializer.Generic.cs">
177+
<Link>Jsv\JsvSerializer.Generic.cs</Link>
178+
</Compile>
179+
<Compile Include="..\ServiceStack.Text\Jsv\JsvTypeSerializer.cs">
180+
<Link>Jsv\JsvTypeSerializer.cs</Link>
181+
</Compile>
182+
<Compile Include="..\ServiceStack.Text\Jsv\JsvWriter.Generic.cs">
183+
<Link>Jsv\JsvWriter.Generic.cs</Link>
184+
</Compile>
185+
<Compile Include="..\ServiceStack.Text\ListExtensions.cs">
186+
<Link>ListExtensions.cs</Link>
187+
</Compile>
188+
<Compile Include="..\ServiceStack.Text\MapExtensions.cs">
189+
<Link>MapExtensions.cs</Link>
190+
</Compile>
191+
<Compile Include="..\ServiceStack.Text\Marc\Link.cs">
192+
<Link>Marc\Link.cs</Link>
193+
</Compile>
194+
<Compile Include="..\ServiceStack.Text\Marc\ObjectAccessor.cs">
195+
<Link>Marc\ObjectAccessor.cs</Link>
196+
</Compile>
197+
<Compile Include="..\ServiceStack.Text\Marc\TypeAccessor.cs">
198+
<Link>Marc\TypeAccessor.cs</Link>
199+
</Compile>
200+
<Compile Include="..\ServiceStack.Text\QueryStringSerializer.cs">
201+
<Link>QueryStringSerializer.cs</Link>
202+
</Compile>
203+
<Compile Include="..\ServiceStack.Text\ReflectionExtensions.cs">
204+
<Link>ReflectionExtensions.cs</Link>
205+
</Compile>
206+
<Compile Include="..\ServiceStack.Text\Reflection\StaticAccessors.cs">
207+
<Link>Reflection\StaticAccessors.cs</Link>
208+
</Compile>
209+
<Compile Include="..\ServiceStack.Text\StreamExtensions.cs">
210+
<Link>StreamExtensions.cs</Link>
211+
</Compile>
212+
<Compile Include="..\ServiceStack.Text\StringExtensions.cs">
213+
<Link>StringExtensions.cs</Link>
214+
</Compile>
215+
<Compile Include="..\ServiceStack.Text\Support\AssemblyTypeDefinition.cs">
216+
<Link>Support\AssemblyTypeDefinition.cs</Link>
217+
</Compile>
218+
<Compile Include="..\ServiceStack.Text\Support\DoubleConverter.cs">
219+
<Link>Support\DoubleConverter.cs</Link>
220+
</Compile>
221+
<Compile Include="..\ServiceStack.Text\Support\TypePair.cs">
222+
<Link>Support\TypePair.cs</Link>
223+
</Compile>
224+
<Compile Include="..\ServiceStack.Text\TextExtensions.cs">
225+
<Link>TextExtensions.cs</Link>
226+
</Compile>
227+
<Compile Include="..\ServiceStack.Text\Tracer.cs">
228+
<Link>Tracer.cs</Link>
229+
</Compile>
230+
<Compile Include="..\ServiceStack.Text\TranslateListWithElements.cs">
231+
<Link>TranslateListWithElements.cs</Link>
232+
</Compile>
233+
<Compile Include="..\ServiceStack.Text\TypeConfig.cs">
234+
<Link>TypeConfig.cs</Link>
235+
</Compile>
236+
<Compile Include="..\ServiceStack.Text\TypeSerializer.cs">
237+
<Link>TypeSerializer.cs</Link>
238+
</Compile>
239+
<Compile Include="..\ServiceStack.Text\TypeSerializer.Generic.cs">
240+
<Link>TypeSerializer.Generic.cs</Link>
241+
</Compile>
242+
<Compile Include="..\ServiceStack.Text\XmlSerializer.cs">
243+
<Link>XmlSerializer.cs</Link>
244+
</Compile>
245+
<Compile Include="Properties\AssemblyInfo.cs" />
246+
</ItemGroup>
247+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
248+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
249+
Other similar extension points exist, see Microsoft.Common.targets.
250+
<Target Name="BeforeBuild">
251+
</Target>
252+
<Target Name="AfterBuild">
253+
</Target>
254+
-->
255+
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.Text.MonoTouch", "ServiceStack.Text.MonoTouch.csproj", "{9A3F2C71-F6BE-491F-86F7-01708C2263BE}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Any CPU = Debug|Any CPU
9+
Release|Any CPU = Release|Any CPU
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{9A3F2C71-F6BE-491F-86F7-01708C2263BE}.Release|Any CPU.Build.0 = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

src/ServiceStack.Text/Common/DeserializeBuiltin.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ private static ParseStringDelegate GetParseFn()
5656
return value => DateTimeSerializer.ParseShortestXsdDateTime(value);
5757
if (typeof(T) == typeof(TimeSpan))
5858
return value => TimeSpan.Parse(value);
59-
if (typeof(T) == typeof(System.Data.Linq.Binary))
59+
#if !MONOTOUCH
60+
if (typeof(T) == typeof(System.Data.Linq.Binary))
6061
return value => new System.Data.Linq.Binary(Convert.FromBase64String(value));
61-
62+
#endif
6263
if (typeof(T) == typeof(char))
6364
{
6465
char cValue;

src/ServiceStack.Text/Common/DeserializeType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
//
1212

1313
#if !XBOX && !MONOTOUCH && !SILVERLIGHT
14-
using System.Linq;
1514
using System.Reflection.Emit;
1615
#endif
1716

1817
using System;
1918
using System.Collections.Generic;
2019
using System.Reflection;
2120
using System.Runtime.Serialization;
21+
using System.Linq;
2222

2323
namespace ServiceStack.Text.Common
2424
{

src/ServiceStack.Text/Common/JsWriter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ public JsWriter()
129129
{ typeof(Uri), Serializer.WriteObjectString },
130130
{ typeof(Type), WriteType },
131131
{ typeof(Exception), Serializer.WriteException },
132-
{ typeof(System.Data.Linq.Binary), Serializer.WriteLinqBinary },
132+
#if !MONOTOUCH
133+
{ typeof(System.Data.Linq.Binary), Serializer.WriteLinqBinary },
134+
#endif
133135
};
134136
}
135137

src/ServiceStack.Text/Json/JsonTypeSerializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ public void WriteEnumFlags(TextWriter writer, object enumFlagValue)
255255

256256
public void WriteLinqBinary(TextWriter writer, object linqBinaryValue)
257257
{
258+
#if !MONOTOUCH
258259
WriteRawString(writer, Convert.ToBase64String(((System.Data.Linq.Binary)linqBinaryValue).ToArray()));
260+
#endif
259261
}
260262

261263
public ParseStringDelegate GetParseFn<T>()

src/ServiceStack.Text/Jsv/JsvTypeSerializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ public void WriteEnumFlags(TextWriter writer, object enumFlagValue)
198198

199199
public void WriteLinqBinary(TextWriter writer, object linqBinaryValue)
200200
{
201+
#if !MONOTOUCH
201202
WriteRawString(writer, Convert.ToBase64String(((System.Data.Linq.Binary)linqBinaryValue).ToArray()));
203+
#endif
202204
}
203205

204206
public object EncodeMapKey(object value)

0 commit comments

Comments
 (0)