Merge pull request #91079 from paulloz/dotnet/enforce-use-sdk-8

Enforce using .NET SDK >= 8
This commit is contained in:
Rémi Verschelde 2024-04-24 09:59:53 +02:00
commit ba3007d127
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 12 additions and 9 deletions

View File

@ -151,7 +151,7 @@ def find_any_msbuild_tool(mono_prefix):
return None
def run_msbuild(tools: ToolsLocation, sln: str, msbuild_args: Optional[List[str]] = None):
def run_msbuild(tools: ToolsLocation, sln: str, chdir_to: str, msbuild_args: Optional[List[str]] = None):
using_msbuild_mono = False
# Preference order: dotnet CLI > Standalone MSBuild > Mono's MSBuild
@ -190,7 +190,8 @@ def run_msbuild(tools: ToolsLocation, sln: str, msbuild_args: Optional[List[str]
}
)
return subprocess.call(args, env=msbuild_env)
# We want to control cwd when running msbuild, because that's where the search for global.json begins.
return subprocess.call(args, env=msbuild_env, cwd=chdir_to)
def build_godot_api(msbuild_tool, module_dir, output_dir, push_nupkgs_local, precision):
@ -218,11 +219,7 @@ def build_godot_api(msbuild_tool, module_dir, output_dir, push_nupkgs_local, pre
args += ["/p:GodotFloat64=true"]
sln = os.path.join(module_dir, "glue/GodotSharp/GodotSharp.sln")
exit_code = run_msbuild(
msbuild_tool,
sln=sln,
msbuild_args=args,
)
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
if exit_code != 0:
return exit_code
@ -361,7 +358,7 @@ def build_all(msbuild_tool, module_dir, output_dir, godot_platform, dev_debug, p
args += ["/p:ClearNuGetLocalCache=true", "/p:PushNuGetToLocalSource=" + push_nupkgs_local]
if precision == "double":
args += ["/p:GodotFloat64=true"]
exit_code = run_msbuild(msbuild_tool, sln=sln, msbuild_args=args)
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
if exit_code != 0:
return exit_code
@ -372,7 +369,7 @@ def build_all(msbuild_tool, module_dir, output_dir, godot_platform, dev_debug, p
if precision == "double":
args += ["/p:GodotFloat64=true"]
sln = os.path.join(module_dir, "editor/Godot.NET.Sdk/Godot.NET.Sdk.sln")
exit_code = run_msbuild(msbuild_tool, sln=sln, msbuild_args=args)
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
if exit_code != 0:
return exit_code

6
modules/mono/global.json Normal file
View File

@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestMajor"
}
}