Skip to content

Commit

Permalink
Add serialization integration projects
Browse files Browse the repository at this point in the history
  • Loading branch information
bugthesystem committed Feb 13, 2015
1 parent 25ca3cb commit b90f712
Show file tree
Hide file tree
Showing 22 changed files with 396 additions and 84 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5F20EAF-9E8E-4CED-90F3-F19869570B7C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FireSharp.Serialization.JsonNet</RootNamespace>
<AssemblyName>FireSharp.Serialization.JsonNet</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="JsonSerializerWrapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="FireSharp.Serialization.JsonNet.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FireSharp\FireSharp.csproj">
<Project>{67B7EA6F-DC34-4F48-8331-58DF137D78C9}</Project>
<Name>FireSharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>FireSharp.Serialization.JsonNet</id>
<version>2.0.0-beta2</version>
<title>Fire# Serialization JsonNet</title>
<authors>ziyasal</authors>
<owners>ziyasal</owners>
<licenseUrl>https://github.com/ziyasal/FireSharp/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/ziyasal/FireSharp</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Provides JSON serialization support using Newtonsoft.JsonNet.</description>
<language>en-US</language>
<tags>firebase rest api client realtime newtonsoft jsonnet json</tags>
<dependencies>
<dependency id="RestSharp" version="104.4.0" />
<dependency id="Newtonsoft.Json" version="6.0.4" />
<dependency id="FireSharp" version="2.0.0-beta2" />
</dependencies>
</metadata>
<files>
<file src="bin\Release\FireSharp.Serialization.JsonNet.dll" target="lib\net45\FireSharp.Serialization.JsonNet.dll" />
</files>
</package>
18 changes: 18 additions & 0 deletions FireSharp.Serialization.JsonNet/JsonSerializerWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using FireSharp.Interfaces;
using Newtonsoft.Json;

namespace FireSharp.Serialization.JsonNet
{
internal class JsonSerializerWrapper : ISerializer
{
public T Deserialize<T>(string json)
{
return JsonConvert.DeserializeObject<T>(json);
}

public string Serialize<T>(T value)
{
return JsonConvert.SerializeObject(value);
}
}
}
39 changes: 39 additions & 0 deletions FireSharp.Serialization.JsonNet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("FireSharp.Serialization.JsonNet")]
[assembly: AssemblyDescription("Provides JSON serialization support using Newtonsoft.JsonNet.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FireSharp.Serialization.JsonNet")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("2eda7645-3da5-4131-971f-b2861facd164")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
6 changes: 6 additions & 0 deletions FireSharp.Serialization.JsonNet/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>

<packages>
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
<package id="RestSharp" version="104.4.0" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7B0E3BC1-4C1D-4748-B678-3197E8E194FC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FireSharp.Serialization.ServiceStack</RootNamespace>
<AssemblyName>FireSharp.Serialization.ServiceStack</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ServiceStack.Text">
<HintPath>..\packages\ServiceStack.Text.4.0.18\lib\net40\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ServiceStackJsonSerializer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="FireSharp.Serialization.ServiceStack.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FireSharp\FireSharp.csproj">
<Project>{67B7EA6F-DC34-4F48-8331-58DF137D78C9}</Project>
<Name>FireSharp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>FireSharp.Serialization.ServiceStack</id>
<version>2.0.0-beta2</version>
<title>Fire# Serialization ServiceStack</title>
<authors>ziyasal</authors>
<owners>ziyasal</owners>
<licenseUrl>https://github.com/ziyasal/FireSharp/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/ziyasal/FireSharp</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Provides JSON serialization support using ServiceStack.Text.</description>
<language>en-US</language>
<tags>firebase rest api client realtime servicestack json</tags>
<dependencies>
<dependency id="RestSharp" version="104.4.0" />
<dependency id="ServiceStack.Text" version="3.9.70" />
<dependency id="FireSharp" version="2.0.0-beta2" />
</dependencies>
</metadata>
<files>
<file src="bin\Release\FireSharp.Serialization.ServiceStack.dll" target="lib\net45\FireSharp.Serialization.ServiceStack.dll" />
</files>
</package>
39 changes: 39 additions & 0 deletions FireSharp.Serialization.ServiceStack/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("FireSharp.Serialization.ServiceStack")]
[assembly: AssemblyDescription("Provides JSON serialization support using ServiceStack.Text.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FireSharp.Serialization.ServiceStack")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("58917e1e-bd52-4983-9569-490eda166ac6")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]
22 changes: 22 additions & 0 deletions FireSharp.Serialization.ServiceStack/ServiceStackJsonSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using FireSharp.Interfaces;
using ServiceStack.Text;

namespace FireSharp.Serialization.ServiceStack
{
/// <summary>
/// ServiceSatck JSON serializer for request bodies
/// ServiceStack.Text supports DataContract,DataMember attributes
/// </summary>
public class ServiceStackJsonSerializer : ISerializer
{
public T Deserialize<T>(string json)
{
return JsonSerializer.DeserializeFromString<T>(json);
}

public string Serialize<T>(T value)
{
return JsonSerializer.SerializeToString(value);
}
}
}
5 changes: 5 additions & 0 deletions FireSharp.Serialization.ServiceStack/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<packages>
<package id="ServiceStack.Text" version="4.0.18" targetFramework="net45" />
</packages>
9 changes: 9 additions & 0 deletions FireSharp.Test.Console/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.2.28.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

</configuration>
12 changes: 12 additions & 0 deletions FireSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireSharp", "FireSharp\Fire
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireSharp.Test.Console", "FireSharp.Test.Console\FireSharp.Test.Console.csproj", "{0DF0042E-769D-409B-A9F7-19449FD0AFD0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireSharp.Serialization.JsonNet", "FireSharp.Serialization.JsonNet\FireSharp.Serialization.JsonNet.csproj", "{A5F20EAF-9E8E-4CED-90F3-F19869570B7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireSharp.Serialization.ServiceStack", "FireSharp.Serialization.ServiceStack\FireSharp.Serialization.ServiceStack.csproj", "{7B0E3BC1-4C1D-4748-B678-3197E8E194FC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -40,6 +44,14 @@ Global
{0DF0042E-769D-409B-A9F7-19449FD0AFD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0DF0042E-769D-409B-A9F7-19449FD0AFD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0DF0042E-769D-409B-A9F7-19449FD0AFD0}.Release|Any CPU.Build.0 = Release|Any CPU
{A5F20EAF-9E8E-4CED-90F3-F19869570B7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5F20EAF-9E8E-4CED-90F3-F19869570B7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5F20EAF-9E8E-4CED-90F3-F19869570B7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5F20EAF-9E8E-4CED-90F3-F19869570B7C}.Release|Any CPU.Build.0 = Release|Any CPU
{7B0E3BC1-4C1D-4748-B678-3197E8E194FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B0E3BC1-4C1D-4748-B678-3197E8E194FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B0E3BC1-4C1D-4748-B678-3197E8E194FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B0E3BC1-4C1D-4748-B678-3197E8E194FC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 6 additions & 1 deletion FireSharp/Config/FirebaseConfig.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
namespace FireSharp.Config
using FireSharp.Interfaces;

namespace FireSharp.Config
{
public class FirebaseConfig : IFirebaseConfig
{
public FirebaseConfig()
{
TimeoutInMinute = 1;
Serializer = new JsonSerializerWrapper();
}

public string BasePath { get; set; }
public string AuthSecret { get; set; }
public int TimeoutInMinute { get; set; }

public ISerializer Serializer { get; set; }
}
}
Loading

0 comments on commit b90f712

Please sign in to comment.