Skip to content

Commit

Permalink
Move tests to target .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Feb 19, 2023
1 parent 913f56f commit a807978
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion PostReleaseActivities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion eng/GenerateAnalyzerNuspec.targets
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

<PropertyGroup>
<!-- Ideally, we would extract this from the MSBuild task, but we need this as the Target Output before that task is executed -->
<_GenerateAnalyzerNuspecPath>$(ArtifactsBinDir)GenerateAnalyzerNuspec\$(Configuration)\net7.0\GenerateAnalyzerNuspec.dll</_GenerateAnalyzerNuspecPath>
<_GenerateAnalyzerNuspecPath>$(ArtifactsBinDir)GenerateAnalyzerNuspec\$(Configuration)\net8.0\GenerateAnalyzerNuspec.dll</_GenerateAnalyzerNuspecPath>
</PropertyGroup>

<Target Name="BuildGenerateAnalyzerNuspecFile"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,4 +13,4 @@
<ProjectReference Include="..\CSharp\Microsoft.CodeAnalysis.CSharp.Analyzers.csproj" />
<ProjectReference Include="..\VisualBasic\Microsoft.CodeAnalysis.VisualBasic.Analyzers.vbproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,4 +13,4 @@
<ProjectReference Include="..\CSharp\Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers.csproj" />
<ProjectReference Include="..\VisualBasic\Microsoft.CodeAnalysis.VisualBasic.BannedApiAnalyzers.vbproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<DefineConstants>$(DefineConstants),NET_ANALYZERS_TEST</DefineConstants>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<NoWarn>$(NoWarn);xUnit1000;CA1812</NoWarn>

Expand All @@ -17,4 +17,4 @@
<ProjectReference Include="..\CSharp\Analyzers\Microsoft.CodeAnalysis.CSharp.PerformanceSensitiveAnalyzers.csproj" />
<ProjectReference Include="..\CSharp\CodeFixes\Microsoft.CodeAnalysis.CSharp.PerformanceSensitiveAnalyzers.CodeFixes.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Test.Utilities/Test.Utilities.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<NonShipping>true</NonShipping>
<IsShipping>false</IsShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
Expand Down
4 changes: 2 additions & 2 deletions src/Text.Analyzers/UnitTests/Text.Analyzers.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<ItemGroup>
Expand All @@ -10,4 +10,4 @@
<ProjectReference Include="..\CSharp\Text.CSharp.Analyzers.csproj" />
<ProjectReference Include="..\VisualBasic\Text.VisualBasic.Analyzers.vbproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NonShipping>true</NonShipping>
<UseAppHost>false</UseAppHost>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NonShipping>true</NonShipping>
<UseAppHost>false</UseAppHost>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NonShipping>true</NonShipping>
<UseAppHost>false</UseAppHost>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/PerfDiff/PerfDiff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NonShipping>true</NonShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/ReleaseNotesUtil/ReleaseNotesUtil.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NonShipping>true</NonShipping>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<IsShipping>false</IsShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Test.Utilities\Test.Utilities.csproj" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions src/Utilities.UnitTests/Analyzer.Utilities.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<ServerGarbageCollection>true</ServerGarbageCollection>
<NonShipping>true</NonShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
Expand All @@ -12,4 +12,4 @@
<!-- To get all the shared project code, like FlowAnalysis -->
<ProjectReference Include="..\NetAnalyzers\Core\Microsoft.CodeAnalysis.NetAnalyzers.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private static Func<IOperation, IMethodSymbol> CreateFunctionPointerSignatureAcc

var operation = Expression.Variable(typeof(IOperation));

return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, WrappedType)), operation).Compile();
return Expression.Lambda<Func<IOperation, IMethodSymbol>>(Expression.Call(targetMethod, Expression.Convert(operation, wrappedType)), operation).Compile();
}

private IFunctionPointerInvocationOperationWrapper(IOperation operation)
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Compiler/Lightup/LightupHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static Func<T, TProperty> CreatePropertyAccessor<T, TProperty>(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));
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/Compiler/RulesetToEditorconfigConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ static void PopulateRuleIdToComments(string rulesetFilePath, Dictionary<string,
if (node is XElement ruleNode &&
ruleNode.Name == RuleNodeName)
{
XAttribute ruleId = ruleNode.Attribute(RuleIdAttributeName);
XAttribute? ruleId = ruleNode.Attribute(RuleIdAttributeName);
if (ruleId != null)
{
foreach (var comment in ruleNode.Nodes().OfType<XComment>())
Expand Down

0 comments on commit a807978

Please sign in to comment.