From b00c1c1dc7e670d8e6df70a351a228ccf809411d Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 1 Mar 2016 13:32:43 -0800 Subject: [PATCH] Transition to netstandard. - dotnet5.X => netstandard1.y (where y = x-1). - DNXCore50 => netstandardapp1.5. - Applied the same changes to ifdefs. --- .../Runtime/TagHelpers/TagHelperDescriptorFactory.cs | 8 ++++---- .../TagHelperDesignTimeDescriptorFactory.cs | 2 +- .../Runtime/TagHelpers/XmlDocumentationProvider.cs | 2 +- .../TagHelpers/DefaultTagHelperContent.cs | 2 +- src/Microsoft.AspNetCore.Razor.Runtime/project.json | 11 ++++++++--- .../project.json | 6 +++++- .../Editor/BackgroundParser.cs | 4 ++-- src/Microsoft.AspNetCore.Razor/project.json | 11 ++++++++--- .../TagHelpers/TagHelperDescriptorFactoryTest.cs | 2 +- .../TagHelperDesignTimeDescriptorFactoryTest.cs | 2 +- .../TagHelpers/XmlDocumentationProviderTest.cs | 2 +- .../project.json | 9 ++++++--- .../CodeGenerators/CSharpTagHelperRenderingTest.cs | 2 +- .../TagHelperAttributeValueCodeRendererTest.cs | 2 +- .../Text/BufferingTextReaderTest.cs | 2 +- .../Text/TextBufferReaderTest.cs | 2 +- test/Microsoft.AspNetCore.Razor.Test/project.json | 9 ++++++--- 17 files changed, 49 insertions(+), 29 deletions(-) diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDescriptorFactory.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDescriptorFactory.cs index 677363c108..92da7f95e1 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDescriptorFactory.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDescriptorFactory.cs @@ -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 /// 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); diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactory.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactory.cs index 925ed7340c..19694ed25b 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactory.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactory.cs @@ -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; diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/XmlDocumentationProvider.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/XmlDocumentationProvider.cs index 57161a9876..2fe69f5519 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/XmlDocumentationProvider.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/XmlDocumentationProvider.cs @@ -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; diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs index 11602916ec..f84f825297 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs @@ -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) { diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/project.json b/src/Microsoft.AspNetCore.Razor.Runtime/project.json index e49c5928a7..b014948f5d 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/project.json +++ b/src/Microsoft.AspNetCore.Razor.Runtime/project.json @@ -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" + ] } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Razor.Test.Sources/project.json b/src/Microsoft.AspNetCore.Razor.Test.Sources/project.json index d9922b2b26..00b8c25c5a 100644 --- a/src/Microsoft.AspNetCore.Razor.Test.Sources/project.json +++ b/src/Microsoft.AspNetCore.Razor.Test.Sources/project.json @@ -6,6 +6,10 @@ }, "frameworks": { "net451": {}, - "dotnet5.4": {} + "netstandard1.3": { + "imports": [ + "dotnet5.4" + ] + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Razor/Editor/BackgroundParser.cs b/src/Microsoft.AspNetCore.Razor/Editor/BackgroundParser.cs index 7fdea369a3..6051487e2d 100644 --- a/src/Microsoft.AspNetCore.Razor/Editor/BackgroundParser.cs +++ b/src/Microsoft.AspNetCore.Razor/Editor/BackgroundParser.cs @@ -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 diff --git a/src/Microsoft.AspNetCore.Razor/project.json b/src/Microsoft.AspNetCore.Razor/project.json index 4af2e21c20..77a4f1a278 100644 --- a/src/Microsoft.AspNetCore.Razor/project.json +++ b/src/Microsoft.AspNetCore.Razor/project.json @@ -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" + ] } } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDescriptorFactoryTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDescriptorFactoryTest.cs index b0f65eb6e6..3ad660a865 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDescriptorFactoryTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDescriptorFactoryTest.cs @@ -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 diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs index 2a7388c9f3..13d6445d6f 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperDesignTimeDescriptorFactoryTest.cs @@ -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; diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/XmlDocumentationProviderTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/XmlDocumentationProviderTest.cs index 6af95747e4..e85b99b8e3 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/XmlDocumentationProviderTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/XmlDocumentationProviderTest.cs @@ -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; diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/project.json b/test/Microsoft.AspNetCore.Razor.Runtime.Test/project.json index f357c1c17f..f553af82af 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/project.json +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/project.json @@ -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 @@ } } } -} +} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs index d2b0a7f41e..11adbd38bd 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/CSharpTagHelperRenderingTest.cs @@ -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; diff --git a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs index 8e70abc704..4e1deea1a0 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/CodeGenerators/TagHelperAttributeValueCodeRendererTest.cs @@ -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; diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/BufferingTextReaderTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Text/BufferingTextReaderTest.cs index 134f0fd276..c63b60e4a3 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/Text/BufferingTextReaderTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/Text/BufferingTextReaderTest.cs @@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Text RunDisposeTest(r => r.Dispose()); } -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 [Fact] public void CloseDisposesSourceReader() { diff --git a/test/Microsoft.AspNetCore.Razor.Test/Text/TextBufferReaderTest.cs b/test/Microsoft.AspNetCore.Razor.Test/Text/TextBufferReaderTest.cs index a04e47c901..614cb8f412 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/Text/TextBufferReaderTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/Text/TextBufferReaderTest.cs @@ -136,7 +136,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Text RunDisposeTest(r => r.Dispose()); } -#if !DNXCORE50 +#if !NETSTANDARDAPP1_5 [Fact] public void CloseDisposesSourceReader() { diff --git a/test/Microsoft.AspNetCore.Razor.Test/project.json b/test/Microsoft.AspNetCore.Razor.Test/project.json index 7921326daf..201b1efec3 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/project.json +++ b/test/Microsoft.AspNetCore.Razor.Test/project.json @@ -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" } -} +} \ No newline at end of file