From 3e7f33e1b67e3ec45ae0a03bd7115f53a74a1523 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Thu, 21 Feb 2019 09:15:56 -0800 Subject: [PATCH] Omit Environment.Version from CodeDom generated files (dotnet/corefx#35458) * Omit Environment.Version from CodeDom generated files Contributes to https://github.com/dotnet/coreclr/pull/22664 * Disable tests on .NET Framework Commit migrated from https://github.com/dotnet/corefx/commit/89f72f6edb0d4ec18afa8e8138d1f12fdde09e5d --- .../System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs | 3 --- .../System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs | 3 --- src/libraries/System.CodeDom/src/Resources/Strings.resx | 3 --- .../tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs | 6 +++--- .../tests/System/CodeDom/Compiler/VBCodeGenerationTests.cs | 6 +++--- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs b/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs index 93cbac4..be4185a 100644 --- a/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs +++ b/src/libraries/System.CodeDom/src/Microsoft/CSharp/CSharpCodeGenerator.cs @@ -2521,9 +2521,6 @@ namespace Microsoft.CSharp Output.WriteLine(SR.AutoGen_Comment_Line1); Output.Write("// "); Output.WriteLine(SR.AutoGen_Comment_Line2); - Output.Write("// "); - Output.Write(SR.AutoGen_Comment_Line3); - Output.WriteLine(Environment.Version.ToString()); Output.WriteLine("//"); Output.Write("// "); Output.WriteLine(SR.AutoGen_Comment_Line4); diff --git a/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs b/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs index 6d17b36..394c936 100644 --- a/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs +++ b/src/libraries/System.CodeDom/src/Microsoft/VisualBasic/VBCodeGenerator.cs @@ -2183,9 +2183,6 @@ namespace Microsoft.VisualBasic Output.WriteLine(SR.AutoGen_Comment_Line1); Output.Write("' "); Output.WriteLine(SR.AutoGen_Comment_Line2); - Output.Write("' "); - Output.Write(SR.AutoGen_Comment_Line3); - Output.WriteLine(Environment.Version.ToString()); Output.WriteLine("'"); Output.Write("' "); Output.WriteLine(SR.AutoGen_Comment_Line4); diff --git a/src/libraries/System.CodeDom/src/Resources/Strings.resx b/src/libraries/System.CodeDom/src/Resources/Strings.resx index 1547ead..4458b9c 100644 --- a/src/libraries/System.CodeDom/src/Resources/Strings.resx +++ b/src/libraries/System.CodeDom/src/Resources/Strings.resx @@ -119,9 +119,6 @@ This code was generated by a tool. - - Runtime Version: - Changes to this file may cause incorrect behavior and will be lost if diff --git a/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs b/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs index b3d0672..5ce6188 100644 --- a/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs +++ b/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs @@ -612,6 +612,7 @@ namespace System.CodeDom.Compiler.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void MetadataAttributes() { RemoteInvoke(() => @@ -739,7 +740,6 @@ namespace System.CodeDom.Compiler.Tests @"//------------------------------------------------------------------------------ // // This code was generated by a tool. - // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1449,6 +1449,7 @@ namespace System.CodeDom.Compiler.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void RegionsSnippetsAndLinePragmas() { RemoteInvoke(() => @@ -1630,7 +1631,6 @@ namespace System.CodeDom.Compiler.Tests //------------------------------------------------------------------------------ // // This code was generated by a tool. - // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -2571,6 +2571,7 @@ namespace System.CodeDom.Compiler.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void ProviderSupports() { RemoteInvoke(() => @@ -3125,7 +3126,6 @@ namespace System.CodeDom.Compiler.Tests @"//------------------------------------------------------------------------------ // // This code was generated by a tool. - // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/VBCodeGenerationTests.cs b/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/VBCodeGenerationTests.cs index 3ec43ee..b2ec2ab 100644 --- a/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/VBCodeGenerationTests.cs +++ b/src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/VBCodeGenerationTests.cs @@ -578,6 +578,7 @@ namespace System.CodeDom.Compiler.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void MetadataAttributes() { RemoteInvoke(() => @@ -705,7 +706,6 @@ namespace System.CodeDom.Compiler.Tests @"'------------------------------------------------------------------------------ ' ' This code was generated by a tool. - ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -1399,6 +1399,7 @@ namespace System.CodeDom.Compiler.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void RegionsSnippetsAndLinePragmas() { RemoteInvoke(() => @@ -1580,7 +1581,6 @@ namespace System.CodeDom.Compiler.Tests '------------------------------------------------------------------------------ ' ' This code was generated by a tool. - ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -2362,6 +2362,7 @@ namespace System.CodeDom.Compiler.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void ProviderSupports() { RemoteInvoke(() => @@ -2926,7 +2927,6 @@ namespace System.CodeDom.Compiler.Tests @"'------------------------------------------------------------------------------ ' ' This code was generated by a tool. - ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. -- 2.7.4