Transition to netstandard.

- dotnet5.X => netstandard1.y (where y = x-1).
- DNXCore50 => netstandardapp1.5.
- Applied the same changes to ifdefs.
This commit is contained in:
N. Taylor Mullen 2016-03-01 13:36:06 -08:00
parent c7f64d34bb
commit c33b422d7a
11 changed files with 85 additions and 53 deletions

View File

@ -15,12 +15,17 @@
"emitEntryPoint": true "emitEntryPoint": true
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": {},
"dnxcore50": { "netstandardapp1.5": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.0.0-*" "NETStandard.Library": "1.0.0-*"
} },
"imports": [
"dnxcore50"
]
} }
}, },
"content": [ "hosting.json" ] "content": [
} "hosting.json"
]
}

View File

@ -17,13 +17,18 @@
"emitEntryPoint": true "emitEntryPoint": true
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": {},
"dnxcore50": { "netstandardapp1.5": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.0.0-*", "NETStandard.Library": "1.0.0-*",
"System.Console": "4.0.0-*" "System.Console": "4.0.0-*"
} },
"imports": [
"dnxcore50"
]
} }
}, },
"content": [ "hosting.json" ] "content": [
} "hosting.json"
]
}

View File

@ -71,7 +71,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Https
X509Certificate2 certificate2 = certificate as X509Certificate2; X509Certificate2 certificate2 = certificate as X509Certificate2;
if (certificate2 == null) if (certificate2 == null)
{ {
#if DOTNET5_4 #if NETSTANDARD1_3
// conversion X509Certificate to X509Certificate2 not supported // conversion X509Certificate to X509Certificate2 not supported
// https://github.com/dotnet/corefx/issues/4510 // https://github.com/dotnet/corefx/issues/4510
return false; return false;

View File

@ -2,7 +2,9 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"compilationOptions": { "compilationOptions": {
"keyFile": "../../tools/Key.snk", "keyFile": "../../tools/Key.snk",
"nowarn": [ "CS1591" ], "nowarn": [
"CS1591"
],
"xmlDoc": true "xmlDoc": true
}, },
"description": "Adds HTTPS support to Kestrel", "description": "Adds HTTPS support to Kestrel",
@ -14,12 +16,15 @@
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*" "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"net451": { }, "net451": {},
"dotnet5.4": { "netstandard1.3": {
"dependencies": { "dependencies": {
"System.Net.Security": "4.0.0-*" "System.Net.Security": "4.0.0-*"
}, },
"imports": "portable-net45+win8" "imports": [
"dotnet5.4",
"portable-net45+win8"
]
} }
} }
} }

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Infrastructure
{ {
public static class TaskUtilities public static class TaskUtilities
{ {
#if DOTNET5_4 #if NETSTANDARD1_3
public static Task CompletedTask = Task.CompletedTask; public static Task CompletedTask = Task.CompletedTask;
#else #else
public static Task CompletedTask = Task.FromResult<object>(null); public static Task CompletedTask = Task.FromResult<object>(null);
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Infrastructure
public static Task GetCancelledTask(CancellationToken cancellationToken) public static Task GetCancelledTask(CancellationToken cancellationToken)
{ {
#if DOTNET5_4 #if NETSTANDARD1_3
return Task.FromCanceled(cancellationToken); return Task.FromCanceled(cancellationToken);
#else #else
var tcs = new TaskCompletionSource<object>(); var tcs = new TaskCompletionSource<object>();

View File

@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Networking
{ {
static PlatformApis() static PlatformApis()
{ {
#if DOTNET5_4 #if NETSTANDARD1_3
IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
IsDarwin = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); IsDarwin = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
#else #else

View File

@ -8,7 +8,7 @@
"dependencies": { "dependencies": {
"System.Buffers": "4.0.0-*", "System.Buffers": "4.0.0-*",
"System.Numerics.Vectors": "4.1.1-*", "System.Numerics.Vectors": "4.1.1-*",
"System.Threading.Tasks.Extensions": "4.0.0-*", "System.Threading.Tasks.Extensions": "4.0.0-*",
"Microsoft.AspNetCore.Hosting": "1.0.0-*", "Microsoft.AspNetCore.Hosting": "1.0.0-*",
"Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-*", "Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
@ -27,7 +27,7 @@
"System.Threading.Tasks": "" "System.Threading.Tasks": ""
} }
}, },
"dotnet5.4": { "netstandard1.3": {
"dependencies": { "dependencies": {
"System.Collections": "4.0.11-*", "System.Collections": "4.0.11-*",
"System.Diagnostics.Debug": "4.0.11-*", "System.Diagnostics.Debug": "4.0.11-*",
@ -46,13 +46,18 @@
"System.Threading.ThreadPool": "4.0.10-*", "System.Threading.ThreadPool": "4.0.10-*",
"System.Threading.Timer": "4.0.1-*" "System.Threading.Timer": "4.0.1-*"
}, },
"imports": "portable-net45+win8" "imports": [
"dotnet5.4",
"portable-net45+win8"
]
} }
}, },
"compilationOptions": { "compilationOptions": {
"allowUnsafe": true, "allowUnsafe": true,
"keyFile": "../../tools/Key.snk", "keyFile": "../../tools/Key.snk",
"nowarn": [ "CS1591" ], "nowarn": [
"CS1591"
],
"xmlDoc": true "xmlDoc": true
}, },
"packInclude": { "packInclude": {
@ -62,4 +67,4 @@
"runtimes/win7-arm/native/": "runtimes/win7-arm/native/*", "runtimes/win7-arm/native/": "runtimes/win7-arm/native/*",
"runtimes/osx/native/": "runtimes/osx/native/*" "runtimes/osx/native/": "runtimes/osx/native/*"
} }
} }

View File

@ -16,12 +16,15 @@
} }
}, },
"frameworks": { "frameworks": {
"dnxcore50": { "netstandardapp1.5": {
"dependencies": { "dependencies": {
"dotnet-test-xunit": "1.0.0-dev-*", "dotnet-test-xunit": "1.0.0-dev-*",
"System.Net.Http": "4.0.1-*" "System.Net.Http": "4.0.1-*"
}, },
"imports": "portable-net451+win8" "imports": [
"dnxcore50",
"portable-net451+win8"
]
}, },
"net451": { "net451": {
"dependencies": { "dependencies": {

View File

@ -16,7 +16,7 @@
} }
}, },
"frameworks": { "frameworks": {
"dnxcore50": { "netstandardapp1.5": {
"dependencies": { "dependencies": {
"System.Diagnostics.TraceSource": "4.0.0-*", "System.Diagnostics.TraceSource": "4.0.0-*",
"System.Globalization.Extensions": "4.0.1-*", "System.Globalization.Extensions": "4.0.1-*",
@ -27,7 +27,10 @@
"System.Runtime.Handles": "4.0.1-*", "System.Runtime.Handles": "4.0.1-*",
"dotnet-test-xunit": "1.0.0-dev-*" "dotnet-test-xunit": "1.0.0-dev-*"
}, },
"imports": "portable-net451+win8" "imports": [
"dnxcore50",
"portable-net451+win8"
]
}, },
"net451": { "net451": {
"dependencies": { "dependencies": {

View File

@ -1,24 +1,27 @@
{ {
"version": "1.0.0-*", "version": "1.0.0-*",
"compilationOptions": { "compilationOptions": {
"emitEntryPoint": true "emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNetCore.Http.Features": "1.0.0-*",
"Microsoft.AspNetCore.Hosting": "1.0.0-*"
},
"frameworks": {
"netstandardapp1.5": {
"dependencies": {
"NETStandard.Library": "1.0.0-*"
},
"imports": [
"dnxcore50"
]
}, },
"dependencies": { "dnx451": {
"Microsoft.AspNetCore.Http.Features": "1.0.0-*", "frameworkAssemblies": {
"Microsoft.AspNetCore.Hosting": "1.0.0-*" "System.Runtime": "",
}, "System.Text.Encoding": "",
"frameworks": { "System.Threading.Tasks": ""
"dnxcore50": { }
"dependencies": {
"NETStandard.Library": "1.0.0-*"
}
},
"dnx451": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.Text.Encoding": "",
"System.Threading.Tasks": ""
}
}
} }
} }
}

View File

@ -8,12 +8,15 @@
"Newtonsoft.Json": "8.0.2" "Newtonsoft.Json": "8.0.2"
}, },
"frameworks": { "frameworks": {
"dnxcore50": { "netstandardapp1.5": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.0.0-*", "NETStandard.Library": "1.0.0-*",
"System.Dynamic.Runtime": "4.0.11-*" "System.Dynamic.Runtime": "4.0.11-*"
} },
"imports": [
"dnxcore50"
]
}, },
"dnx451": { } "dnx451": {}
} }
} }