-Updated build to use .NET CLI

-.NET Standard 1.0 included in package
This commit is contained in:
James Newton-King
2016-05-14 13:43:43 +12:00
parent e31200aead
commit e8f4a3b651
17 changed files with 496 additions and 121 deletions
@@ -31,7 +31,9 @@ using System.Security;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
#if PORTABLE40
#if NETSTANDARD10
[assembly: AssemblyTitle("Json.NET Tests .NET Standard 1.0")]
#elif PORTABLE40
[assembly: AssemblyTitle("Json.NET Tests Portable .NET 4.0")]
#elif PORTABLE
[assembly: AssemblyTitle("Json.NET Tests Portable")]
@@ -27,7 +27,7 @@ using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE)
#if !(NET20 || NET35 || NETFX_CORE || PORTABLE || DNXCORE50)
using System.Runtime.Serialization.Json;
#endif
using System.Text;
@@ -5286,7 +5286,7 @@ Path '', line 1, position 1.");
}
#endif
#if !NETFX_CORE
#if !(NETFX_CORE || DNXCORE50)
public class XmlNodeTestObject
{
public XmlDocument Document { get; set; }
@@ -71,7 +71,12 @@ namespace Newtonsoft.Json.Tests.Serialization
[Test]
public void GetAttributes_Property()
{
PropertyInfo property = typeof(ReflectionTestObject).GetProperty("TestProperty");
PropertyInfo property;
#if DNXCORE50
property = Newtonsoft.Json.Utilities.TypeExtensions.GetProperty(typeof(ReflectionTestObject), "TestProperty");
#else
property = typeof(ReflectionTestObject).GetProperty("TestProperty");
#endif
ReflectionAttributeProvider provider = new ReflectionAttributeProvider(property);
@@ -85,7 +90,12 @@ namespace Newtonsoft.Json.Tests.Serialization
[Test]
public void GetAttributes_Field()
{
FieldInfo field = (FieldInfo)typeof(ReflectionTestObject).GetField("TestField");
FieldInfo field;
#if DNXCORE50
field = (FieldInfo)Newtonsoft.Json.Utilities.TypeExtensions.GetField(typeof(ReflectionTestObject), "TestField");
#else
field = typeof(ReflectionTestObject).GetField("TestField");
#endif
ReflectionAttributeProvider provider = new ReflectionAttributeProvider(field);
@@ -74,11 +74,14 @@ namespace Newtonsoft.Json.Tests.Serialization
var possibleMsgs = new[]
{
"[1] - Error message for member 1 = An item with the same key has already been added.",
"[1] - Error message for member 1 = An element with the same key already exists in the dictionary." // mono
"[1] - Error message for member 1 = An element with the same key already exists in the dictionary.", // mono
"[1] - Error message for member 1 = An item with the same key has already been added. Key: Jim" // netcore
};
VersionKeyedCollection c = JsonConvert.DeserializeObject<VersionKeyedCollection>(json);
Assert.AreEqual(1, c.Count);
Assert.AreEqual(1, c.Messages.Count);
Console.WriteLine(c.Messages[0]);
Assert.IsTrue(possibleMsgs.Any(m => m == c.Messages[0]), "Expected One of: " + Environment.NewLine + string.Join(Environment.NewLine, possibleMsgs) + Environment.NewLine + "Was: " + Environment.NewLine + c.Messages[0]);
}
@@ -41,7 +41,7 @@ using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
#if !(NETFX_CORE || NET20 || NET35)
#if !(NETFX_CORE || NET20 || NET35 || DNXCORE50)
using System.Runtime.Serialization.Json;
#endif
using Newtonsoft.Json.Serialization;
@@ -66,7 +66,11 @@ namespace Newtonsoft.Json.Tests.TestObjects
public override bool CanConvert(Type objectType)
{
#if DNXCORE50
return Newtonsoft.Json.Utilities.TypeExtensions.IsAssignableFrom(typeof(IList<T>), objectType);
#else
return typeof(IList<T>).IsAssignableFrom(objectType);
#endif
}
}
}
+22 -39
View File
@@ -7,11 +7,9 @@
"target": "project"
}
},
"commands": {
"test": "xunit.runner.dnx -parallel none"
},
"testRunner": "xunit",
"frameworks": {
"net45": {
/*"net45": {
"frameworkAssemblies": {
"System.Collections": "",
"System.ComponentModel.DataAnnotations": "",
@@ -38,7 +36,6 @@
},
"net40": {
"frameworkAssemblies": {
"System.Collections": "",
"System.ComponentModel.DataAnnotations": "",
"System.Data": "",
"System.Data.DataSetExtensions": "",
@@ -46,7 +43,6 @@
"System.Data.Linq": "",
"System.Drawing": "",
"System.Numerics": "",
"System.Runtime": "",
"System.Runtime.Serialization": "",
"System.Web": "",
"System.Web.Extensions": "",
@@ -87,40 +83,27 @@
"dependencies": {
"NUnit": "2.6.4"
}
},
"dnxcore50": {
},*/
"netcoreapp1.0": {
"compilationOptions": {
"define": [ "NETSTANDARD10", "DNXCORE50", "PORTABLE" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.0",
"System.Collections": "4.0.10",
"System.Collections.Immutable": "1.1.37",
"System.ComponentModel.TypeConverter": "4.0.0",
"System.Diagnostics.Debug": "4.0.10",
"System.Dynamic.Runtime": "4.0.10",
"System.Globalization": "4.0.10",
"System.IO": "4.0.10",
"System.Linq": "4.0.0",
"System.Linq.Expressions": "4.0.10",
"System.Reflection.Emit.ILGeneration": "4.0.0",
"System.Reflection.Extensions": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.Numerics": "4.0.0",
"System.Runtime.Serialization.Json": "4.0.0",
"System.Runtime.Serialization.Primitives": "4.0.10",
"System.Runtime.Serialization.Xml": "4.0.10",
"System.Text.Encoding": "4.0.10",
"System.Text.Encoding.CodePages": "4.0.0",
"System.Text.Encoding.Extensions": "4.0.10",
"System.Text.RegularExpressions": "4.0.10",
"System.Threading": "4.0.10",
"System.Xml.ReaderWriter": "4.0.10",
"System.Xml.XDocument": "4.0.10",
"System.Xml.XmlDocument": "4.0.0",
"System.Xml.XmlSerializer": "4.0.10",
"xunit": "2.1.0-*",
"xunit.runner.dnx": "2.1.0-rc1-build204"
}
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-24027"
},
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24027",
"System.Xml.XmlSerializer": "4.0.11-rc2-24027",
"System.Runtime.Serialization.Json": "4.0.2-rc2-24027",
"System.Runtime.Serialization.Xml": "4.1.1-rc2-24027",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-rc2-173361-36"
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
}
}
@@ -32,7 +32,9 @@ using System.Security;
// 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.
#if PORTABLE40
#if NETSTANDARD10
[assembly: AssemblyTitle("Json.NET .NET Standard 1.0")]
#elif PORTABLE40
[assembly: AssemblyTitle("Json.NET Portable .NET 4.0")]
#elif PORTABLE
[assembly: AssemblyTitle("Json.NET Portable")]
@@ -48,7 +50,6 @@ using System.Security;
[assembly: AssemblyTitle("Json.NET .NET 4.0")]
[assembly: AllowPartiallyTrustedCallers]
#else
[assembly: AssemblyTitle("Json.NET")]
[assembly: AllowPartiallyTrustedCallers]
#endif
@@ -40,7 +40,6 @@ using System.Runtime.Serialization;
#if !(DOTNET || PORTABLE || PORTABLE40)
using System.Security.Permissions;
#endif
using System.Xml.Serialization;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Utilities;
using Newtonsoft.Json.Linq;
+28 -26
View File
@@ -1,5 +1,5 @@
{
"version": "7.0.2-beta1",
"version": "1.0.0-*",
"title": "Json.NET",
"description": "Json.NET is a popular high-performance JSON framework for .NET",
"authors": [ "James Newton-King" ],
@@ -61,6 +61,7 @@
"System.ObjectModel": "",
"System.Reflection": "",
"System.Reflection.Extensions": "",
"System.Resources.ResourceManager": "",
"System.Runtime": "",
"System.Runtime.Extensions": "",
"System.Runtime.Serialization": "",
@@ -88,32 +89,33 @@
"System.Xml": ""
}
},
"dotnet": {
"netstandard1.0": {
"compilationOptions": {
"define": [ "NETSTANDARD10", "PORTABLE" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.0",
"System.Collections": "4.0.10",
"System.Collections.Concurrent": "4.0.10",
"System.ComponentModel.TypeConverter": "4.0.0",
"System.Diagnostics.Debug": "4.0.10",
"System.Dynamic.Runtime": "4.0.10",
"System.Globalization": "4.0.10",
"System.IO": "4.0.10",
"System.Linq": "4.0.0",
"System.Linq.Expressions": "4.0.10",
"System.ObjectModel": "4.0.10",
"System.Reflection": "4.0.10",
"System.Reflection.Extensions": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.Numerics": "4.0.0",
"System.Runtime.Serialization.Primitives": "4.0.10",
"System.Text.Encoding": "4.0.10",
"System.Text.Encoding.Extensions": "4.0.10",
"System.Text.RegularExpressions": "4.0.10",
"System.Threading": "4.0.10",
"System.Threading.Tasks": "4.0.10",
"System.Xml.ReaderWriter": "4.0.10",
"System.Xml.XDocument": "4.0.10"
"Microsoft.CSharp": "4.0.1-rc2-24027",
"System.Collections": "4.0.11-rc2-24027",
"System.Diagnostics.Debug": "4.0.11-rc2-24027",
"System.Dynamic.Runtime": "4.0.11-rc2-24027",
"System.Globalization": "4.0.11-rc2-24027",
"System.IO": "4.1.0-rc2-24027",
"System.Linq": "4.1.0-rc2-24027",
"System.Linq.Expressions": "4.0.11-rc2-24027",
"System.ObjectModel": "4.0.12-rc2-24027",
"System.Reflection": "4.1.0-rc2-24027",
"System.Reflection.Extensions": "4.0.1-rc2-24027",
"System.Resources.ResourceManager": "4.0.1-rc2-24027",
"System.Runtime": "4.1.0-rc2-24027",
"System.Runtime.Extensions": "4.1.0-rc2-24027",
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24027",
"System.Text.Encoding": "4.0.11-rc2-24027",
"System.Text.Encoding.Extensions": "4.0.11-rc2-24027",
"System.Text.RegularExpressions": "4.0.12-rc2-24027",
"System.Threading": "4.0.11-rc2-24027",
"System.Threading.Tasks": "4.0.11-rc2-24027",
"System.Xml.ReaderWriter": "4.0.11-rc2-24027",
"System.Xml.XDocument": "4.0.11-rc2-24027"
}
}
}
+3 -3
View File
@@ -3,8 +3,8 @@
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="AspNet VNext (CI Builds)" value="https://www.myget.org/F/aspnetvnext/api/v2" />
<add key="xunit (CI Builds)" value="https://www.myget.org/F/xunit/api/v2" />
<add key="NuGet.org (v2)" value="https://www.nuget.org/api/v2" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
<add key="NuGet.org (v3)" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
+2 -5
View File
@@ -1,6 +1,3 @@
{
"projects": [ "src" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
"projects": [ "src" ]
}