From 7ab381f2e84067056f274ba9a6852448716f3dee Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sun, 8 Dec 2013 14:38:03 +1300 Subject: [PATCH] -Fixed builds --- Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs | 6 +++++- Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs | 2 ++ .../Linq/JsonPath/JPathExecuteTests.cs | 4 ++++ .../Linq/JsonPath/QueryExpressionTests.cs | 2 -- .../Newtonsoft.Json.Tests.Net20.csproj | 4 +++- .../Newtonsoft.Json.Tests.Net35.csproj | 4 +++- .../Newtonsoft.Json.Tests.Net40.csproj | 4 +++- .../Newtonsoft.Json.Tests.Portable.csproj | 4 +++- .../Newtonsoft.Json.Tests.Portable40.csproj | 4 +++- Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs | 2 +- Src/Newtonsoft.Json/Converters/DataTableConverter.cs | 1 - .../Converters/DiscriminatedUnionConverter.cs | 4 ++++ Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs | 2 -- Src/Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs | 1 - Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj | 11 ++++++++++- Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj | 11 ++++++++++- Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj | 11 ++++++++++- Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj | 11 ++++++++++- Src/Newtonsoft.Json/Newtonsoft.Json.Portable40.csproj | 11 ++++++++++- Src/Newtonsoft.Json/Properties/AssemblyInfo.cs | 2 +- .../Serialization/JsonSerializerInternalReader.cs | 1 - Src/Newtonsoft.Json/Utilities/ConvertUtils.cs | 6 +++--- 22 files changed, 85 insertions(+), 23 deletions(-) diff --git a/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs b/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs index af451447..3595ae4b 100644 --- a/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs +++ b/Src/Newtonsoft.Json.Tests/Bson/BsonReaderTests.cs @@ -1546,14 +1546,16 @@ namespace Newtonsoft.Json.Tests.Bson public class MyBinder : DefaultSerializationBinder { - public bool BindToNameCalled { get; set; } public bool BindToTypeCalled { get; set; } +#if !(NET20 || NET35) + public bool BindToNameCalled { get; set; } public override void BindToName(Type serializedType, out string assemblyName, out string typeName) { BindToNameCalled = true; base.BindToName(serializedType, out assemblyName, out typeName); } +#endif public override Type BindToType(string assemblyName, string typeName) { @@ -1595,7 +1597,9 @@ namespace Newtonsoft.Json.Tests.Bson Assert.AreEqual("Dog!", deserialized.Animals[0].Name); Assert.IsTrue(deserialized.Animals[0] is Dog); +#if !(NET20 || NET35) Assert.IsTrue(binder.BindToNameCalled); +#endif Assert.IsTrue(binder.BindToTypeCalled); } } diff --git a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs index 70c1f22e..1017ea95 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JValueTests.cs @@ -609,6 +609,7 @@ namespace Newtonsoft.Json.Tests.Linq } #endif +#if !(PORTABLE40 || NET35 || NET20) [Test] public void ExpicitConversionTest() { @@ -631,6 +632,7 @@ namespace Newtonsoft.Json.Tests.Linq byte[] dataBytes = (byte[])o.data; Assert.AreEqual(example, Encoding.UTF8.GetString(dataBytes)); } +#endif [Test] public void GetTypeCode() diff --git a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs index 89bddb4b..4d70475c 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/JPathExecuteTests.cs @@ -25,7 +25,9 @@ using System; using System.Collections.Generic; +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) using System.Numerics; +#endif using Newtonsoft.Json.Linq.JsonPath; using Newtonsoft.Json.Tests.Bson; #if !NETFX_CORE @@ -434,6 +436,7 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath Assert.IsTrue(JToken.DeepEquals(new JObject(new JProperty("hi", 3)), t[1])); } +#if !(PORTABLE || PORTABLE40 || NET35 || NET20) [Test] public void GreaterQueryBigInteger() { @@ -448,6 +451,7 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath Assert.IsTrue(JToken.DeepEquals(new JObject(new JProperty("hi", 2)), t[0])); Assert.IsTrue(JToken.DeepEquals(new JObject(new JProperty("hi", 3)), t[1])); } +#endif [Test] public void GreaterOrEqualQuery() diff --git a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/QueryExpressionTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/QueryExpressionTests.cs index c7d9b21d..6571c920 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JsonPath/QueryExpressionTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JsonPath/QueryExpressionTests.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq.JsonPath; #if !NETFX_CORE diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj index bebda336..92932bc1 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net20.csproj @@ -90,8 +90,10 @@ - + + + diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj index 2cb0991c..8b370b01 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net35.csproj @@ -132,8 +132,10 @@ - + + + diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj index 566b8346..f1d7da90 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Net40.csproj @@ -249,8 +249,10 @@ - + + + diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj index c92c76db..d3b4c024 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable.csproj @@ -134,8 +134,10 @@ - + + + diff --git a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj index ce8e0cc2..e68bf380 100644 --- a/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj +++ b/Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.Portable40.csproj @@ -131,8 +131,10 @@ - + + + diff --git a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs index fa1ee484..8ca28e0d 100644 --- a/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs @@ -75,4 +75,4 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] -[assembly: AssemblyFileVersion("5.0.8.16801")] +[assembly: AssemblyFileVersion("5.0.8.16808")] diff --git a/Src/Newtonsoft.Json/Converters/DataTableConverter.cs b/Src/Newtonsoft.Json/Converters/DataTableConverter.cs index 490dd061..0d5ae665 100644 --- a/Src/Newtonsoft.Json/Converters/DataTableConverter.cs +++ b/Src/Newtonsoft.Json/Converters/DataTableConverter.cs @@ -25,7 +25,6 @@ using System.Collections.Generic; using System.Globalization; -using System.Linq; using Newtonsoft.Json.Utilities; #if !(NETFX_CORE || PORTABLE40 || PORTABLE) using System; diff --git a/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs b/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs index fba3603e..11b68fa8 100644 --- a/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs +++ b/Src/Newtonsoft.Json/Converters/DiscriminatedUnionConverter.cs @@ -27,7 +27,11 @@ using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; +#if NET20 +using Newtonsoft.Json.Utilities.LinqBridge; +#else using System.Linq; +#endif using System.Reflection; using Newtonsoft.Json.Serialization; using System.Globalization; diff --git a/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs b/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs index c83c5251..92634d0e 100644 --- a/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs +++ b/Src/Newtonsoft.Json/Linq/JsonPath/JPath.cs @@ -26,9 +26,7 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Linq; using System.Text; -using System.Xml.Linq; using Newtonsoft.Json.Utilities; namespace Newtonsoft.Json.Linq.JsonPath diff --git a/Src/Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs b/Src/Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs index b564a06e..bbdfbcbf 100644 --- a/Src/Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs +++ b/Src/Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; namespace Newtonsoft.Json.Linq.JsonPath { diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj index b8f9878c..9cba95ac 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Net20.csproj @@ -88,6 +88,7 @@ + @@ -106,6 +107,15 @@ + + + + + + + + + @@ -123,7 +133,6 @@ - diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj index 5c303751..a9806a4c 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Net35.csproj @@ -96,6 +96,7 @@ + @@ -118,6 +119,15 @@ + + + + + + + + + @@ -130,7 +140,6 @@ - diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj index 5051da43..7c798394 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Net40.csproj @@ -99,6 +99,7 @@ + @@ -119,6 +120,15 @@ + + + + + + + + + @@ -129,7 +139,6 @@ - diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj index b0c46e1d..a069c0d1 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Portable.csproj @@ -57,6 +57,7 @@ + @@ -107,11 +108,19 @@ - + + + + + + + + + diff --git a/Src/Newtonsoft.Json/Newtonsoft.Json.Portable40.csproj b/Src/Newtonsoft.Json/Newtonsoft.Json.Portable40.csproj index 2c6f5ed6..5d36b70e 100644 --- a/Src/Newtonsoft.Json/Newtonsoft.Json.Portable40.csproj +++ b/Src/Newtonsoft.Json/Newtonsoft.Json.Portable40.csproj @@ -62,6 +62,7 @@ + @@ -112,11 +113,19 @@ - + + + + + + + + + diff --git a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs index 7e22f040..bf252a6e 100644 --- a/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs +++ b/Src/Newtonsoft.Json/Properties/AssemblyInfo.cs @@ -91,5 +91,5 @@ using System.Security; // by using the '*' as shown below: [assembly: AssemblyVersion("4.5.0.0")] -[assembly: AssemblyFileVersion("5.0.8.16801")] +[assembly: AssemblyFileVersion("5.0.8.16808")] [assembly: CLSCompliant(true)] diff --git a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs index 96ada2a3..10f06d34 100644 --- a/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs +++ b/Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs @@ -44,7 +44,6 @@ using Newtonsoft.Json.Utilities; using Newtonsoft.Json.Utilities.LinqBridge; #else using System.Linq; - #endif namespace Newtonsoft.Json.Serialization diff --git a/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs b/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs index d84ee72b..a33da5bb 100644 --- a/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs +++ b/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs @@ -232,10 +232,10 @@ namespace Newtonsoft.Json.Utilities public static TimeSpan ParseTimeSpan(string input) { -#if !(NET35 || NET20 || PORTABLE40) - return TimeSpan.Parse((string)input, CultureInfo.InvariantCulture); +#if !(NET35 || NET20) + return TimeSpan.Parse(input, CultureInfo.InvariantCulture); #else - return TimeSpan.Parse((string)input); + return TimeSpan.Parse(input); #endif }