-Added NuPack to build process

-Fixed deserializing structs when reusing existing values
-Renamed Windows Phone 7 dll to Newtonsoft.Json.WindowsPhone.dll
This commit is contained in:
JamesNK
2010-10-12 07:15:13 +00:00
parent 4cea6d3c09
commit 336f14b3d2
14 changed files with 108 additions and 41 deletions
@@ -47,7 +47,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\DotNet20\</OutputPath>
<OutputPath>bin\Debug\Net20\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET20</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -56,7 +56,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\DotNet20\</OutputPath>
<OutputPath>bin\Release\Net20\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -49,7 +49,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\DotNet35\</OutputPath>
<OutputPath>bin\Debug\Net35\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -58,7 +58,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\DotNet35\</OutputPath>
<OutputPath>bin\Release\Net35\</OutputPath>
<DefineConstants>TRACE;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -9,8 +9,8 @@
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json.Tests.Phone</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests.Phone</AssemblyName>
<RootNamespace>Newtonsoft.Json.Tests.WindowsPhone</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests.WindowsPhone</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
<TargetFrameworkProfile>WindowsPhone</TargetFrameworkProfile>
@@ -23,7 +23,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Bin\Debug\Phone\</OutputPath>
<OutputPath>Bin\Debug\WindowsPhone\</OutputPath>
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
@@ -33,7 +33,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Bin\Release\Phone\</OutputPath>
<OutputPath>Bin\Release\WindowsPhone\</OutputPath>
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
@@ -211,9 +211,9 @@
<Compile Include="Utilities\ReflectionUtilsTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Newtonsoft.Json\Newtonsoft.Json.Phone.csproj">
<ProjectReference Include="..\Newtonsoft.Json\Newtonsoft.Json.WindowsPhone.csproj">
<Project>{7A7F70AB-5C07-47ED-BDD2-ECC14DBACA5E}</Project>
<Name>Newtonsoft.Json.Phone</Name>
<Name>Newtonsoft.Json.WindowsPhone</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
@@ -49,7 +49,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\DotNet\</OutputPath>
<OutputPath>bin\Debug\Net\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -58,7 +58,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\DotNet\</OutputPath>
<OutputPath>bin\Release\Net\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -3665,5 +3665,37 @@ keyword such as type of business.""
IDictionary<string, decimal> d = JsonConvert.DeserializeObject<IDictionary<string, decimal>>(json);
Assert.AreEqual(123456789876543.21m, d["Value"]);
}
public struct Vector
{
public float X;
public float Y;
public float Z;
public override string ToString()
{
return string.Format("({0},{1},{2})", X, Y, Z);
}
}
public class VectorParent
{
public Vector Position;
}
[Test]
public void DeserializeStructProperty()
{
VectorParent obj = new VectorParent();
obj.Position = new Vector { X = 1, Y = 2, Z = 3 };
string str = JsonConvert.SerializeObject(obj);
obj = JsonConvert.DeserializeObject<VectorParent>(str);
Assert.AreEqual(1, obj.Position.X);
Assert.AreEqual(2, obj.Position.Y);
Assert.AreEqual(3, obj.Position.Z);
}
}
}