diff options
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/SCsub | 38 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_builds.cpp | 14 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_editor.cpp | 7 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_editor.h | 1 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_assembly.cpp | 7 | ||||
-rw-r--r-- | modules/mono/utils/path_utils.cpp | 6 |
6 files changed, 39 insertions, 34 deletions
diff --git a/modules/mono/SCsub b/modules/mono/SCsub index 9f90a7b70c..27e60c4623 100644 --- a/modules/mono/SCsub +++ b/modules/mono/SCsub @@ -97,29 +97,31 @@ def find_msbuild_unix(filename): def find_msbuild_windows(): import mono_reg_utils as monoreg - msbuild_tools_path = monoreg.find_msbuild_tools_path_reg() + bits = env['bits'] - if msbuild_tools_path: - return (os.path.join(msbuild_tools_path, 'MSBuild.exe'), '') + if bits == '32': + if os.getenv('MONO32_PREFIX'): + mono_root = os.getenv('MONO32_PREFIX') + else: + mono_root = monoreg.find_mono_root_dir(bits) else: - bits = env['bits'] - - if bits == '32': - if os.getenv('MONO32_PREFIX'): - mono_root = os.getenv('MONO32_PREFIX') - else: - mono_root = monoreg.find_mono_root_dir(bits) + if os.getenv('MONO64_PREFIX'): + mono_root = os.getenv('MONO64_PREFIX') else: - if os.getenv('MONO64_PREFIX'): - mono_root = os.getenv('MONO64_PREFIX') - else: - mono_root = monoreg.find_mono_root_dir(bits) + mono_root = monoreg.find_mono_root_dir(bits) - if mono_root: - msbuild_mono = os.path.join(mono_root, 'bin', 'msbuild.bat') + if not mono_root: + raise RuntimeError('Cannot find mono root directory') + + msbuild_tools_path = monoreg.find_msbuild_tools_path_reg() + + if msbuild_tools_path: + return (os.path.join(msbuild_tools_path, 'MSBuild.exe'), os.path.join(mono_root, 'lib', 'mono', '4.5')) + else: + msbuild_mono = os.path.join(mono_root, 'bin', 'msbuild.bat') - if os.path.isfile(msbuild_mono): - return (msbuild_mono, os.path.join(mono_root, 'lib', 'mono', '4.5')) + if os.path.isfile(msbuild_mono): + return (msbuild_mono, '') return None diff --git a/modules/mono/editor/godotsharp_builds.cpp b/modules/mono/editor/godotsharp_builds.cpp index aaea1bc839..83d2bb1471 100644 --- a/modules/mono/editor/godotsharp_builds.cpp +++ b/modules/mono/editor/godotsharp_builds.cpp @@ -32,6 +32,7 @@ #include "main/main.h" #include "../godotsharp_dirs.h" +#include "../mono_gd/gd_mono.h" #include "../mono_gd/gd_mono_class.h" #include "../mono_gd/gd_mono_marshal.h" #include "../utils/path_utils.h" @@ -84,10 +85,16 @@ void godot_icall_BuildInstance_get_MSBuildInfo(MonoString **r_msbuild_path, Mono if (!msbuild_tools_path.ends_with("\\")) msbuild_tools_path += "\\"; - *r_msbuild_path = GDMonoMarshal::mono_string_from_godot(msbuild_tools_path + "MSBuild.exe"); - // FrameworkPathOverride - *r_framework_path = GDMonoMarshal::mono_string_from_godot(GDMono::get_singleton()->get_mono_reg_info().assembly_dir); + const MonoRegInfo &mono_reg_info = GDMono::get_singleton()->get_mono_reg_info(); + if (mono_reg_info.assembly_dir.length()) { + *r_msbuild_path = GDMonoMarshal::mono_string_from_godot(msbuild_tools_path + "MSBuild.exe"); + + String framework_path = path_join(mono_reg_info.assembly_dir, "mono", "4.5"); + *r_framework_path = GDMonoMarshal::mono_string_from_godot(framework_path); + } else { + ERR_PRINT("Cannot find Mono's assemblies directory in the registry"); + } return; } @@ -130,6 +137,7 @@ void godot_icall_BuildInstance_get_MSBuildInfo(MonoString **r_msbuild_path, Mono return; #else + ERR_PRINT("Not implemented on this platform"); return; #endif } diff --git a/modules/mono/editor/godotsharp_editor.cpp b/modules/mono/editor/godotsharp_editor.cpp index 39c57ee0be..837dbfde66 100644 --- a/modules/mono/editor/godotsharp_editor.cpp +++ b/modules/mono/editor/godotsharp_editor.cpp @@ -171,11 +171,6 @@ Error GodotSharpEditor::open_in_external_editor(const Ref<Script> &p_script, int String script_path = ProjectSettings::get_singleton()->globalize_path(p_script->get_path()); monodevel_instance->execute(script_path); } break; - case EDITOR_VISUAL_STUDIO: - // TODO - // devenv <PathToSolutionFolder> - // devenv /edit <PathToCsFile> /command "edit.goto <Line>" - // HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7 default: return ERR_UNAVAILABLE; } @@ -229,7 +224,7 @@ GodotSharpEditor::GodotSharpEditor(EditorNode *p_editor) { if (!ed_settings->has_setting("mono/editor/external_editor")) { ed_settings->set_setting("mono/editor/external_editor", EDITOR_NONE); } - ed_settings->add_property_hint(PropertyInfo(Variant::INT, "mono/editor/external_editor", PROPERTY_HINT_ENUM, "None,MonoDevelop,Visual Studio,Visual Studio Code")); + ed_settings->add_property_hint(PropertyInfo(Variant::INT, "mono/editor/external_editor", PROPERTY_HINT_ENUM, "None,MonoDevelop,Visual Studio Code")); } GodotSharpEditor::~GodotSharpEditor() { diff --git a/modules/mono/editor/godotsharp_editor.h b/modules/mono/editor/godotsharp_editor.h index 7b4b50b172..0f2c163582 100644 --- a/modules/mono/editor/godotsharp_editor.h +++ b/modules/mono/editor/godotsharp_editor.h @@ -69,7 +69,6 @@ public: enum ExternalEditor { EDITOR_NONE, EDITOR_MONODEVELOP, - EDITOR_VISUAL_STUDIO, EDITOR_CODE, }; diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp index 0d9b137f99..7dc7043eec 100644 --- a/modules/mono/mono_gd/gd_mono_assembly.cpp +++ b/modules/mono/mono_gd/gd_mono_assembly.cpp @@ -107,10 +107,11 @@ MonoAssembly *GDMonoAssembly::_preload_hook(MonoAssemblyName *aname, char **asse search_dirs.push_back(String(rootdir).plus_file("mono").plus_file("4.5")); } - while (assemblies_path) { - if (*assemblies_path) + if (assemblies_path) { + while (*assemblies_path) { search_dirs.push_back(*assemblies_path); - ++assemblies_path; + ++assemblies_path; + } } } diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index c8581f6122..105c2c981e 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -56,9 +56,6 @@ String path_which(const String &p_name) { for (int i = 0; i < env_path.size(); i++) { String p = path_join(env_path[i], p_name); - if (FileAccess::exists(p)) - return p; - #ifdef WINDOWS_ENABLED for (int j = 0; j < exts.size(); j++) { String p2 = p + exts[j]; @@ -66,6 +63,9 @@ String path_which(const String &p_name) { if (FileAccess::exists(p2)) return p2; } +#else + if (FileAccess::exists(p)) + return p; #endif } |