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:32:43 -08:00
parent 9f675abbca
commit b00c1c1dc7
17 changed files with 49 additions and 29 deletions

View File

@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
RegexOptions.None,
Constants.RegexMatchTimeout);
#if !DOTNET5_4
#if !NETSTANDARD1_3
private readonly TagHelperDesignTimeDescriptorFactory _designTimeDescriptorFactory;
#endif
private readonly bool _designTime;
@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
/// </param>
public TagHelperDescriptorFactory(bool designTime)
{
#if !DOTNET5_4
#if !NETSTANDARD1_3
if (designTime)
{
_designTimeDescriptorFactory = new TagHelperDesignTimeDescriptorFactory();
@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
{
TagHelperDesignTimeDescriptor typeDesignTimeDescriptor = null;
#if !DOTNET5_4
#if !NETSTANDARD1_3
if (_designTime)
{
typeDesignTimeDescriptor = _designTimeDescriptorFactory.CreateDescriptor(type);
@ -706,7 +706,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
{
TagHelperAttributeDesignTimeDescriptor propertyDesignTimeDescriptor = null;
#if !DOTNET5_4
#if !NETSTANDARD1_3
if (_designTime)
{
propertyDesignTimeDescriptor = _designTimeDescriptorFactory.CreateAttributeDescriptor(property);

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if !DOTNET5_4 // Cannot accurately resolve the location of the documentation XML file in coreclr.
#if !NETSTANDARD1_3 // Cannot accurately resolve the location of the documentation XML file in coreclr.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if !DOTNET5_4
#if !NETSTANDARD1_3
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -233,7 +233,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
public bool IsWhiteSpace { get; private set; } = true;
#if DOTNET5_4
#if NETSTANDARD1_3
// This is an abstract method in DNXCore
public override void Write(char value)
{

View File

@ -5,7 +5,9 @@
"allowUnsafe": true,
"keyFile": "../../tools/Key.snk",
"warningsAsErrors": true,
"nowarn": [ "CS1591" ],
"nowarn": [
"CS1591"
],
"xmlDoc": true
},
"repository": {
@ -36,12 +38,15 @@
},
"dependencies": {}
},
"dotnet5.4": {
"netstandard1.3": {
"dependencies": {
"System.Reflection.Extensions": "4.0.1-*",
"System.Reflection.TypeExtensions": "4.1.0-*",
"System.Text.RegularExpressions": "4.0.12-*"
}
},
"imports": [
"dotnet5.4"
]
}
}
}

View File

@ -6,6 +6,10 @@
},
"frameworks": {
"net451": {},
"dotnet5.4": {}
"netstandard1.3": {
"imports": [
"dotnet5.4"
]
}
}
}

View File

@ -304,7 +304,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
RazorEditorTrace.TraceLine(RazorResources.FormatTrace_BackgroundThreadStart(fileNameOnly));
EnsureOnThread();
#if DOTNET5_4
#if NETSTANDARD1_3
var spinWait = new SpinWait();
#endif
@ -422,7 +422,7 @@ namespace Microsoft.AspNetCore.Razor.Editor
else
{
RazorEditorTrace.TraceLine(RazorResources.FormatTrace_NoChangesArrived(fileNameOnly));
#if DOTNET5_4
#if NETSTANDARD1_3
// This does the equivalent of thread.yield under the covers.
spinWait.SpinOnce();
#else

View File

@ -4,7 +4,9 @@
"compilationOptions": {
"warningsAsErrors": true,
"keyFile": "../../tools/Key.snk",
"nowarn": [ "CS1591" ],
"nowarn": [
"CS1591"
],
"xmlDoc": true
},
"repository": {
@ -19,14 +21,17 @@
},
"frameworks": {
"net451": {},
"dotnet5.4": {
"netstandard1.3": {
"dependencies": {
"System.IO.FileSystem": "4.0.1-*",
"System.Linq": "4.1.0-*",
"System.Runtime.Extensions": "4.1.0-*",
"System.Security.Cryptography.Algorithms": "4.0.0-*",
"System.Threading.Thread": "4.0.0-*"
}
},
"imports": [
"dotnet5.4"
]
}
}
}

View File

@ -1982,7 +1982,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
}
// TagHelperDesignTimeDescriptors are not created in CoreCLR.
#if !DNXCORE50
#if !NETSTANDARDAPP1_5
public static TheoryData OutputElementHintData
{
get

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if !DNXCORE50
#if !NETSTANDARDAPP1_5
using System;
using System.IO;
using System.Reflection;

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if !DNXCORE50
#if !NETSTANDARDAPP1_5
using System;
using System.Globalization;
using System.IO;

View File

@ -17,8 +17,11 @@
},
"testRunner": "xunit",
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8",
"netstandardapp1.5": {
"imports": [
"dnxcore50",
"portable-net451+win8"
],
"dependencies": {
"dotnet-test-xunit": "1.0.0-dev-*"
}
@ -34,4 +37,4 @@
}
}
}
}
}

View File

@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
#if DNXCORE50
#if NETSTANDARDAPP1_5
using System.Reflection;
#endif
using Microsoft.AspNetCore.Razor.CodeGenerators;

View File

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
#if DNXCORE50
#if NETSTANDARDAPP1_5
using System.Reflection;
#endif
using Microsoft.AspNetCore.Razor.CodeGenerators;

View File

@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Text
RunDisposeTest(r => r.Dispose());
}
#if !DNXCORE50
#if !NETSTANDARDAPP1_5
[Fact]
public void CloseDisposesSourceReader()
{

View File

@ -136,7 +136,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Text
RunDisposeTest(r => r.Dispose());
}
#if !DNXCORE50
#if !NETSTANDARDAPP1_5
[Fact]
public void CloseDisposesSourceReader()
{

View File

@ -14,8 +14,11 @@
},
"testRunner": "xunit",
"frameworks": {
"dnxcore50": {
"imports": "portable-net451+win8",
"netstandardapp1.5": {
"imports": [
"dnxcore50",
"portable-net451+win8"
],
"dependencies": {
"moq.netcore": "4.4.0-beta8",
"dotnet-test-xunit": "1.0.0-dev-*"
@ -39,4 +42,4 @@
"warningsAsErrors": true,
"keyFile": "../../tools/Key.snk"
}
}
}