Skip to content

Commit f2efa54

Browse files
committed
Enforce using .NET SDK >= 8 in modules/mono/
1 parent a754bbc commit f2efa54

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

modules/mono/build_scripts/build_assemblies.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def find_any_msbuild_tool(mono_prefix):
151151
return None
152152

153153

154-
def run_msbuild(tools: ToolsLocation, sln: str, msbuild_args: Optional[List[str]] = None):
154+
def run_msbuild(tools: ToolsLocation, sln: str, chdir_to: str, msbuild_args: Optional[List[str]] = None):
155155
using_msbuild_mono = False
156156

157157
# 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]
190190
}
191191
)
192192

193-
return subprocess.call(args, env=msbuild_env)
193+
# We want to control cwd when running msbuild, because that's where the search for global.json begins.
194+
return subprocess.call(args, env=msbuild_env, cwd=chdir_to)
194195

195196

196197
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
218219
args += ["/p:GodotFloat64=true"]
219220

220221
sln = os.path.join(module_dir, "glue/GodotSharp/GodotSharp.sln")
221-
exit_code = run_msbuild(
222-
msbuild_tool,
223-
sln=sln,
224-
msbuild_args=args,
225-
)
222+
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
226223
if exit_code != 0:
227224
return exit_code
228225

@@ -361,7 +358,7 @@ def build_all(msbuild_tool, module_dir, output_dir, godot_platform, dev_debug, p
361358
args += ["/p:ClearNuGetLocalCache=true", "/p:PushNuGetToLocalSource=" + push_nupkgs_local]
362359
if precision == "double":
363360
args += ["/p:GodotFloat64=true"]
364-
exit_code = run_msbuild(msbuild_tool, sln=sln, msbuild_args=args)
361+
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
365362
if exit_code != 0:
366363
return exit_code
367364

@@ -372,7 +369,7 @@ def build_all(msbuild_tool, module_dir, output_dir, godot_platform, dev_debug, p
372369
if precision == "double":
373370
args += ["/p:GodotFloat64=true"]
374371
sln = os.path.join(module_dir, "editor/Godot.NET.Sdk/Godot.NET.Sdk.sln")
375-
exit_code = run_msbuild(msbuild_tool, sln=sln, msbuild_args=args)
372+
exit_code = run_msbuild(msbuild_tool, sln=sln, chdir_to=module_dir, msbuild_args=args)
376373
if exit_code != 0:
377374
return exit_code
378375

modules/mono/global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.0",
4+
"rollForward": "latestMajor"
5+
}
6+
}

0 commit comments

Comments
 (0)