Skip to content

Commit 7f5c469

Browse files
authored
Merge pull request #92131 from paulloz/net8
C#: Move GodotSharp to .NET8
2 parents 691d8be + fb8553e commit 7f5c469

31 files changed

+278
-250
lines changed

modules/mono/build_scripts/build_assemblies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def build_godot_api(msbuild_tool, module_dir, output_dir, push_nupkgs_local, pre
229229

230230
core_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotSharp", "bin", build_config))
231231
editor_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotSharpEditor", "bin", build_config))
232-
plugins_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotPlugins", "bin", build_config, "net6.0"))
232+
plugins_src_dir = os.path.abspath(os.path.join(sln, os.pardir, "GodotPlugins", "bin", build_config, "net8.0"))
233233

234234
if not os.path.isdir(editor_api_dir):
235235
assert not os.path.isfile(editor_api_dir)

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Godot.SourceGenerators.Sample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>11</LangVersion>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<LangVersion>12</LangVersion>
66
</PropertyGroup>
77

88
<PropertyGroup>

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/CSharpAnalyzerVerifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class Test : CSharpAnalyzerTest<TAnalyzer, XUnitVerifier>
2121
{
2222
public Test()
2323
{
24-
ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
24+
ReferenceAssemblies = Constants.Net80;
2525

2626
SolutionTransforms.Add((Solution solution, ProjectId projectId) =>
2727
{

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/CSharpCodeFixVerifier.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Microsoft.CodeAnalysis.CodeFixes;
55
using Microsoft.CodeAnalysis.CSharp.Testing;
66
using Microsoft.CodeAnalysis.Diagnostics;
7-
using Microsoft.CodeAnalysis.Testing;
87
using Microsoft.CodeAnalysis.Testing.Verifiers;
98

109
namespace Godot.SourceGenerators.Tests;
@@ -17,7 +16,7 @@ public class Test : CSharpCodeFixTest<TAnalyzer, TCodeFix, XUnitVerifier>
1716
{
1817
public Test()
1918
{
20-
ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
19+
ReferenceAssemblies = Constants.Net80;
2120
SolutionTransforms.Add((Solution solution, ProjectId projectId) =>
2221
{
2322
Project project = solution.GetProject(projectId)!

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/CSharpSourceGeneratorVerifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Test : CSharpSourceGeneratorTest<TSourceGenerator, XUnitVerifier>
1818
{
1919
public Test()
2020
{
21-
ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
21+
ReferenceAssemblies = Constants.Net80;
2222

2323
SolutionTransforms.Add((Solution solution, ProjectId projectId) =>
2424
{

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Constants.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
using System.IO;
22
using System.Reflection;
3+
using Microsoft.CodeAnalysis.Testing;
34

45
namespace Godot.SourceGenerators.Tests;
56

67
public static class Constants
78
{
89
public static Assembly GodotSharpAssembly => typeof(GodotObject).Assembly;
910

11+
// Can't find what needs updating to be able to access ReferenceAssemblies.Net.Net80, so we're making our own one.
12+
public static ReferenceAssemblies Net80 => new ReferenceAssemblies(
13+
"net8.0",
14+
new PackageIdentity("Microsoft.NETCore.App.Ref", "8.0.0"),
15+
Path.Combine("ref", "net8.0")
16+
);
17+
1018
public static string ExecutingAssemblyPath { get; }
1119
public static string SourceFolderPath { get; }
1220
public static string GeneratedSourceFolderPath { get; }

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Godot.SourceGenerators.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
6-
<LangVersion>11</LangVersion>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<LangVersion>12</LangVersion>
76

87
<Nullable>enable</Nullable>
98
<IsPackable>false</IsPackable>

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Godot.SourceGenerators.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<LangVersion>10</LangVersion>
55
<Nullable>enable</Nullable>
6+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
67
</PropertyGroup>
78
<PropertyGroup>
89
<Description>Core C# source generator for Godot projects.</Description>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<ProjectGuid>{639E48BD-44E5-4091-8EDD-22D36DC0768D}</ProjectGuid>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>10</LangVersion>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<LangVersion>12</LangVersion>
67
<Nullable>enable</Nullable>
78
</PropertyGroup>
9+
810
</Project>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<ProjectGuid>{A8CDAD94-C6D4-4B19-A7E7-76C53CC92984}</ProjectGuid>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>10</LangVersion>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<LangVersion>12</LangVersion>
67
<Nullable>enable</Nullable>
78
</PropertyGroup>
9+
810
<ItemGroup>
911
<PackageReference Include="Microsoft.Build" Version="15.1.548" ExcludeAssets="runtime" />
1012
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
1113
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
1214
</ItemGroup>
15+
1316
<ItemGroup>
1417
<ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj" />
1518
<ProjectReference Include="..\GodotTools.Shared\GodotTools.Shared.csproj" />
1619
</ItemGroup>
20+
1721
</Project>

0 commit comments

Comments
 (0)