Skip to content

Commit

Permalink
Bump .NET to 9. (#361)
Browse files Browse the repository at this point in the history
* Bump .NET to 9.

* Refactor

* Bump .net in pipeline

* Disable Husky in CI
  • Loading branch information
sailro authored Nov 14, 2024
1 parent 9651544 commit e88c458
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
DOTNET_NOLOGO: 1
UNITY_HASH: '11fa355cd605'
UNITY_FULL_VERSION: '6000.0.24f1'
HUSKY: 0

jobs:
compute:
Expand Down Expand Up @@ -67,7 +68,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'

- name: Download Unity on ${{ matrix.os }}
run: ${{ matrix.download }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We also ship them on [NuGet](https://nuget.org/packages/Microsoft.Unity.Analyzer
If you have an idea for a best practice for Unity developers to follow, please open an [issue](https://github.com/microsoft/Microsoft.Unity.Analyzers/issues/new?template=Feature_request.md) with the description.

# Prerequisites
For building and testing, you'll need **.NET 7 and Visual Studio 2022 17.4+, Visual Studio 2022 for Mac 17.4+ or Visual Studio Code 1.76+**.
For building and testing, you'll need **.NET 9 and Visual Studio 2022 17.12+, or Visual Studio Code 1.92+**.

This project binaries are targeting **Visual Studio 2019 16.4+**, **Visual Studio for Mac 8.4+** and **Visual Studio Code 1.76+**.

Expand Down
7 changes: 3 additions & 4 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.7.0" />
<!-- Analyzers -->
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
<!-- MPack -->
<PackageVersion Include="MonoDevelop.Addins" Version="0.4.7" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.0" />
Expand All @@ -20,12 +19,12 @@
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.9.3166" />
<!-- Tests -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="8.0.1" />
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="9.0.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
<!-- Misc -->
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected static DiagnosticResult ExpectSuppressor(SuppressionDescriptor descrip
return result;
}

private static IEnumerable<DiagnosticAnalyzer> LoadAnalyzers(string assembly)
private static ImmutableArray<DiagnosticAnalyzer> LoadAnalyzers(string assembly)
{
var fullpath = Path.GetFullPath(assembly);
var reference = new AnalyzerFileReference(fullpath, new AnalyzerAssemblyLoader());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Win32.Registry" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" VersionOverride="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" GeneratePathProperty="true" />
Expand All @@ -29,7 +28,8 @@
<Visible>False</Visible>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="$(PkgMicrosoft_CodeAnalysis_NetAnalyzers)\analyzers\dotnet\cs\*.dll">
<!-- Use NetAnalyzer SDK-assemblies -->
<None Include="$(MicrosoftNETBuildTasksDirectoryRoot)..\analyzers\*.dll">
<Visible>False</Visible>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Unity.Analyzers/NonGenericGetComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private static async Task<Document> UseGenericGetComponentAsync(Document documen
.WithExpression(GenericName(
identifierSyntax.Identifier,
TypeArgumentList(
SeparatedList(new[] { typeOf.Type }))))
SeparatedList([typeOf.Type]))))
.WithArgumentList(newArgumentList);

// If we're casting the GetComponent result, remove the cast as the returned value is now type safe
Expand Down
2 changes: 1 addition & 1 deletion src/new-analyzer/new-analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>NewAnalyzer</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down

0 comments on commit e88c458

Please sign in to comment.