Browse Source

Fix .NET exporting in Linux

- Fix platform detection after Linux OS name was renamed from `LinuxBSD`
to `Linux`
- Fix arch detection after renaming `64` to `x86_64`
- Fix typo in `find_hostfxr`
Raul Santos 3 years ago
parent
commit
b0274d0ee7

+ 3 - 2
modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs

@@ -176,8 +176,9 @@ namespace GodotTools.Build
                 arguments.Add("--no-restore");
                 arguments.Add("--no-restore");
 
 
             // Incremental or rebuild
             // Incremental or rebuild
-            if (buildInfo.Rebuild)
-                arguments.Add("--no-incremental");
+            // TODO: Not supported in `dotnet publish` (https://github.com/dotnet/sdk/issues/11099)
+            // if (buildInfo.Rebuild)
+            //     arguments.Add("--no-incremental");
 
 
             // Configuration
             // Configuration
             arguments.Add("-c");
             arguments.Add("-c");

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs

@@ -112,7 +112,7 @@ namespace GodotTools.Export
             string buildConfig = isDebug ? "ExportDebug" : "ExportRelease";
             string buildConfig = isDebug ? "ExportDebug" : "ExportRelease";
 
 
             // TODO: This works for now, as we only implemented support for x86 family desktop so far, but it needs to be fixed
             // TODO: This works for now, as we only implemented support for x86 family desktop so far, but it needs to be fixed
-            string arch = features.Contains("64") ? "x86_64" : "x86";
+            string arch = features.Contains("x86_64") ? "x86_64" : "x86";
 
 
             string ridOS = DetermineRuntimeIdentifierOS(platform);
             string ridOS = DetermineRuntimeIdentifierOS(platform);
             string ridArch = DetermineRuntimeIdentifierArch(arch);
             string ridArch = DetermineRuntimeIdentifierArch(arch);

+ 1 - 3
modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs

@@ -70,9 +70,7 @@ namespace GodotTools.Utils
         {
         {
             ["Windows"] = Platforms.Windows,
             ["Windows"] = Platforms.Windows,
             ["macOS"] = Platforms.MacOS,
             ["macOS"] = Platforms.MacOS,
-            ["LinuxBSD"] = Platforms.LinuxBSD,
-            // "X11" for compatibility, temporarily, while we are on an outdated branch
-            ["X11"] = Platforms.LinuxBSD,
+            ["Linux"] = Platforms.LinuxBSD,
             ["UWP"] = Platforms.UWP,
             ["UWP"] = Platforms.UWP,
             ["Haiku"] = Platforms.Haiku,
             ["Haiku"] = Platforms.Haiku,
             ["Android"] = Platforms.Android,
             ["Android"] = Platforms.Android,

+ 3 - 3
modules/mono/mono_gd/gd_mono.cpp

@@ -103,12 +103,12 @@ const char_t *get_data(const HostFxrCharString &p_char_str) {
 }
 }
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
-String find_hostfxr(size_t p_known_buffet_size, get_hostfxr_parameters *p_get_hostfxr_params) {
+String find_hostfxr(size_t p_known_buffer_size, get_hostfxr_parameters *p_get_hostfxr_params) {
 	// Pre-allocate a large buffer for the path to hostfxr
 	// Pre-allocate a large buffer for the path to hostfxr
 	Vector<char_t> buffer;
 	Vector<char_t> buffer;
-	buffer.resize(p_known_buffet_size);
+	buffer.resize(p_known_buffer_size);
 
 
-	int rc = get_hostfxr_path(buffer.ptrw(), &p_known_buffet_size, p_get_hostfxr_params);
+	int rc = get_hostfxr_path(buffer.ptrw(), &p_known_buffer_size, p_get_hostfxr_params);
 
 
 	ERR_FAIL_COND_V_MSG(rc != 0, String(), "get_hostfxr_path failed with code: " + itos(rc));
 	ERR_FAIL_COND_V_MSG(rc != 0, String(), "get_hostfxr_path failed with code: " + itos(rc));