From a8079780f4bd39a4864f22177260a0c40492023e Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 16 Dec 2022 11:48:43 +0200 Subject: [PATCH] Move tests to target .NET 8 --- PostReleaseActivities.md | 2 +- eng/GenerateAnalyzerNuspec.targets | 2 +- .../Microsoft.CodeAnalysis.Analyzers.UnitTests.csproj | 4 ++-- ...Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests.csproj | 4 ++-- ...icrosoft.CodeAnalysis.ResxSourceGenerator.UnitTests.csproj | 2 +- .../Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj | 2 +- ...odeAnalysis.PerformanceSensitiveAnalyzers.UnitTests.csproj | 4 ++-- ...Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests.csproj | 2 +- .../UnitTests/Roslyn.Diagnostics.Analyzers.UnitTests.csproj | 2 +- src/Test.Utilities/Test.Utilities.csproj | 2 +- src/Text.Analyzers/UnitTests/Text.Analyzers.UnitTests.csproj | 4 ++-- .../GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj | 2 +- .../GenerateDocumentationAndConfigFiles.csproj | 2 +- ...GenerateDocumentationAndConfigFilesForBrokenRuntime.csproj | 2 +- src/Tools/PerfDiff/PerfDiff.csproj | 2 +- src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj | 2 +- .../Tests/RulesetToEditorconfigConverter.UnitTests.csproj | 4 ++-- src/Utilities.UnitTests/Analyzer.Utilities.UnitTests.csproj | 4 ++-- .../Lightup/IFunctionPointerInvocationOperationWrapper.cs | 2 +- src/Utilities/Compiler/Lightup/LightupHelpers.cs | 2 +- src/Utilities/Compiler/RulesetToEditorconfigConverter.cs | 4 ++-- 21 files changed, 28 insertions(+), 28 deletions(-) diff --git a/PostReleaseActivities.md b/PostReleaseActivities.md index 67d72a82f6..01eba90b5e 100644 --- a/PostReleaseActivities.md +++ b/PostReleaseActivities.md @@ -25,7 +25,7 @@ Please follow the below steps after publishing analyzer NuGet packages from this 1. Checkout the sources for the release branch locally. This would normally be the main branch. 2. Build. 3. Ensure that nuget.exe is on path. -4. Generate notes: Switch to the output directory, say `artifacts\bin\ReleaseNotesUtil\Debug\net7.0` and execute `GenDiffNotes.cmd` to generate release notes. Example command line for v2.9.4 to v2.9.5: `GenDiffNotes.cmd C:\scratch nuget.org 2.9.4 2.9.5`. +4. Generate notes: Switch to the output directory, say `artifacts\bin\ReleaseNotesUtil\Debug\net8.0` and execute `GenDiffNotes.cmd` to generate release notes. Example command line for v2.9.4 to v2.9.5: `GenDiffNotes.cmd C:\scratch nuget.org 2.9.4 2.9.5`. ## Followup items diff --git a/eng/GenerateAnalyzerNuspec.targets b/eng/GenerateAnalyzerNuspec.targets index 5730755ded..79686d8961 100644 --- a/eng/GenerateAnalyzerNuspec.targets +++ b/eng/GenerateAnalyzerNuspec.targets @@ -119,7 +119,7 @@ - <_GenerateAnalyzerNuspecPath>$(ArtifactsBinDir)GenerateAnalyzerNuspec\$(Configuration)\net7.0\GenerateAnalyzerNuspec.dll + <_GenerateAnalyzerNuspecPath>$(ArtifactsBinDir)GenerateAnalyzerNuspec\$(Configuration)\net8.0\GenerateAnalyzerNuspec.dll - netcoreapp3.1;net472 + net8.0 true @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests.csproj b/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests.csproj index c895762b1f..7bfa247cc1 100644 --- a/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests.csproj +++ b/src/Microsoft.CodeAnalysis.BannedApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.BannedApiAnalyzers.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.CodeAnalysis.ResxSourceGenerator/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests.csproj b/src/Microsoft.CodeAnalysis.ResxSourceGenerator/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests.csproj index cb2c93b99b..5a67de7e9e 100644 --- a/src/Microsoft.CodeAnalysis.ResxSourceGenerator/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests.csproj +++ b/src/Microsoft.CodeAnalysis.ResxSourceGenerator/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests/Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net8.0 true true diff --git a/src/NetAnalyzers/UnitTests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj b/src/NetAnalyzers/UnitTests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj index 058b1699e5..c11652edc6 100644 --- a/src/NetAnalyzers/UnitTests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj +++ b/src/NetAnalyzers/UnitTests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 $(DefineConstants),NET_ANALYZERS_TEST true diff --git a/src/PerformanceSensitiveAnalyzers/UnitTests/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers.UnitTests.csproj b/src/PerformanceSensitiveAnalyzers/UnitTests/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers.UnitTests.csproj index 660e704e55..5d553a056f 100644 --- a/src/PerformanceSensitiveAnalyzers/UnitTests/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers.UnitTests.csproj +++ b/src/PerformanceSensitiveAnalyzers/UnitTests/Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true $(NoWarn);xUnit1000;CA1812 @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/src/PublicApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests.csproj b/src/PublicApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests.csproj index 2d213aa4db..de91122cd3 100644 --- a/src/PublicApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests.csproj +++ b/src/PublicApiAnalyzers/UnitTests/Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true diff --git a/src/Roslyn.Diagnostics.Analyzers/UnitTests/Roslyn.Diagnostics.Analyzers.UnitTests.csproj b/src/Roslyn.Diagnostics.Analyzers/UnitTests/Roslyn.Diagnostics.Analyzers.UnitTests.csproj index 38ea8f8320..a14259beab 100644 --- a/src/Roslyn.Diagnostics.Analyzers/UnitTests/Roslyn.Diagnostics.Analyzers.UnitTests.csproj +++ b/src/Roslyn.Diagnostics.Analyzers/UnitTests/Roslyn.Diagnostics.Analyzers.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true diff --git a/src/Test.Utilities/Test.Utilities.csproj b/src/Test.Utilities/Test.Utilities.csproj index 6f745673c9..7ecd292467 100644 --- a/src/Test.Utilities/Test.Utilities.csproj +++ b/src/Test.Utilities/Test.Utilities.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true false true diff --git a/src/Text.Analyzers/UnitTests/Text.Analyzers.UnitTests.csproj b/src/Text.Analyzers/UnitTests/Text.Analyzers.UnitTests.csproj index 1d3a690632..c2b01134f1 100644 --- a/src/Text.Analyzers/UnitTests/Text.Analyzers.UnitTests.csproj +++ b/src/Text.Analyzers/UnitTests/Text.Analyzers.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true @@ -10,4 +10,4 @@ - \ No newline at end of file + diff --git a/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj b/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj index ef9a533c0e..241f838ef8 100644 --- a/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj +++ b/src/Tools/GenerateAnalyzerNuspec/GenerateAnalyzerNuspec.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 true false diff --git a/src/Tools/GenerateDocumentationAndConfigFiles/GenerateDocumentationAndConfigFiles.csproj b/src/Tools/GenerateDocumentationAndConfigFiles/GenerateDocumentationAndConfigFiles.csproj index 6418ced81d..7e01dc1aa3 100644 --- a/src/Tools/GenerateDocumentationAndConfigFiles/GenerateDocumentationAndConfigFiles.csproj +++ b/src/Tools/GenerateDocumentationAndConfigFiles/GenerateDocumentationAndConfigFiles.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 true false true diff --git a/src/Tools/GenerateDocumentationAndConfigFilesForBrokenRuntime/GenerateDocumentationAndConfigFilesForBrokenRuntime.csproj b/src/Tools/GenerateDocumentationAndConfigFilesForBrokenRuntime/GenerateDocumentationAndConfigFilesForBrokenRuntime.csproj index 6aa01d1433..876b4f9148 100644 --- a/src/Tools/GenerateDocumentationAndConfigFilesForBrokenRuntime/GenerateDocumentationAndConfigFilesForBrokenRuntime.csproj +++ b/src/Tools/GenerateDocumentationAndConfigFilesForBrokenRuntime/GenerateDocumentationAndConfigFilesForBrokenRuntime.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 true false true diff --git a/src/Tools/PerfDiff/PerfDiff.csproj b/src/Tools/PerfDiff/PerfDiff.csproj index d4a34bcd10..ba04b88c1f 100644 --- a/src/Tools/PerfDiff/PerfDiff.csproj +++ b/src/Tools/PerfDiff/PerfDiff.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 true true diff --git a/src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj b/src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj index 35921e7ff9..2bacc63bfd 100644 --- a/src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj +++ b/src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 true diff --git a/src/Tools/RulesetToEditorconfigConverter/Tests/RulesetToEditorconfigConverter.UnitTests.csproj b/src/Tools/RulesetToEditorconfigConverter/Tests/RulesetToEditorconfigConverter.UnitTests.csproj index 51f132d138..8c77d53042 100644 --- a/src/Tools/RulesetToEditorconfigConverter/Tests/RulesetToEditorconfigConverter.UnitTests.csproj +++ b/src/Tools/RulesetToEditorconfigConverter/Tests/RulesetToEditorconfigConverter.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true false true @@ -9,4 +9,4 @@ - \ No newline at end of file + diff --git a/src/Utilities.UnitTests/Analyzer.Utilities.UnitTests.csproj b/src/Utilities.UnitTests/Analyzer.Utilities.UnitTests.csproj index baddd5d66c..15f48336c7 100644 --- a/src/Utilities.UnitTests/Analyzer.Utilities.UnitTests.csproj +++ b/src/Utilities.UnitTests/Analyzer.Utilities.UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net472 + net8.0 true true true @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/src/Utilities/Compiler/Lightup/IFunctionPointerInvocationOperationWrapper.cs b/src/Utilities/Compiler/Lightup/IFunctionPointerInvocationOperationWrapper.cs index 56ec582cd1..f5ae9d2878 100644 --- a/src/Utilities/Compiler/Lightup/IFunctionPointerInvocationOperationWrapper.cs +++ b/src/Utilities/Compiler/Lightup/IFunctionPointerInvocationOperationWrapper.cs @@ -39,7 +39,7 @@ private static Func CreateFunctionPointerSignatureAcc var operation = Expression.Variable(typeof(IOperation)); - return Expression.Lambda>(Expression.Call(targetMethod, Expression.Convert(operation, WrappedType)), operation).Compile(); + return Expression.Lambda>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile(); } private IFunctionPointerInvocationOperationWrapper(IOperation operation) diff --git a/src/Utilities/Compiler/Lightup/LightupHelpers.cs b/src/Utilities/Compiler/Lightup/LightupHelpers.cs index 8ba9e1d286..39b63ec4ad 100644 --- a/src/Utilities/Compiler/Lightup/LightupHelpers.cs +++ b/src/Utilities/Compiler/Lightup/LightupHelpers.cs @@ -66,7 +66,7 @@ private static Func CreatePropertyAccessor(Type? typ ? parameter : Expression.Convert(parameter, type); - Expression result = Expression.Call(instance, property.GetMethod); + Expression result = Expression.Call(instance, property.GetMethod!); if (!typeof(TProperty).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) { result = Expression.Convert(result, typeof(TProperty)); diff --git a/src/Utilities/Compiler/RulesetToEditorconfigConverter.cs b/src/Utilities/Compiler/RulesetToEditorconfigConverter.cs index 5712c5f121..644be7a245 100644 --- a/src/Utilities/Compiler/RulesetToEditorconfigConverter.cs +++ b/src/Utilities/Compiler/RulesetToEditorconfigConverter.cs @@ -96,7 +96,7 @@ static XElement GetTopLevelRulesetNode(string rulesetFilePath) var ruleSetDocument = XDocument.Load(xmlReader); // Find the top level rule set node - var rulesetNode = ruleSetDocument.Elements(RuleSetNodeName).FirstOrDefault(); + var rulesetNode = ruleSetDocument.Elements(RuleSetNodeName).First(); Debug.Assert(rulesetNode.Name == RuleSetNodeName); return rulesetNode; } @@ -143,7 +143,7 @@ static void PopulateRuleIdToComments(string rulesetFilePath, Dictionary())