diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-14 11:39:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-14 11:39:41 +0200 |
commit | 8995d95da0cfe3acebfb425f00bb1586c1f3a92b (patch) | |
tree | f086280b3f4569c44bc30b60233aa0ca748d148a /modules/mono/mono_gd | |
parent | 6fedb2bf28d613b781d38a1b374ee1917bca0047 (diff) | |
parent | 0b94203a79d3261d4cc3bbcdb3438a5a45c8c572 (diff) |
Merge pull request #31347 from neikeq/monodevelop-addin
C#: Add Ide Connection library and server for the editor
Diffstat (limited to 'modules/mono/mono_gd')
-rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 34 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono.h | 2 |
2 files changed, 23 insertions, 13 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index ee1ecf3be7..eed8812305 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -556,14 +556,14 @@ bool GDMono::_load_corlib_assembly() { } #ifdef TOOLS_ENABLED -bool GDMono::copy_prebuilt_api_assembly(APIAssembly::Type p_api_type) { +bool GDMono::copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config) { bool &api_assembly_out_of_sync = (p_api_type == APIAssembly::API_CORE) ? GDMono::get_singleton()->core_api_assembly_out_of_sync : GDMono::get_singleton()->editor_api_assembly_out_of_sync; - String src_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug"); - String dst_dir = GodotSharpDirs::get_res_assemblies_dir(); + String src_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config); + String dst_dir = GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config); String assembly_name = p_api_type == APIAssembly::API_CORE ? CORE_API_ASSEMBLY_NAME : EDITOR_API_ASSEMBLY_NAME; @@ -626,18 +626,28 @@ String GDMono::update_api_assemblies_from_prebuilt() { if (!api_assembly_out_of_sync && FileAccess::exists(core_assembly_path) && FileAccess::exists(editor_assembly_path)) return String(); // No update needed - print_verbose("Updating API assemblies"); + const int CONFIGS_LEN = 2; + String configs[CONFIGS_LEN] = { String("Debug"), String("Release") }; - String prebuilt_api_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file("Debug"); - String prebuilt_core_dll_path = prebuilt_api_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll"); - String prebuilt_editor_dll_path = prebuilt_api_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); + for (int i = 0; i < CONFIGS_LEN; i++) { + String config = configs[i]; - if (!FileAccess::exists(prebuilt_core_dll_path) || !FileAccess::exists(prebuilt_editor_dll_path)) - return FAIL_REASON(api_assembly_out_of_sync, /* prebuilt_exists: */ false); + print_verbose("Updating '" + config + "' API assemblies"); - // Copy the prebuilt Api - if (!copy_prebuilt_api_assembly(APIAssembly::API_CORE) || !copy_prebuilt_api_assembly(APIAssembly::API_EDITOR)) - return FAIL_REASON(api_assembly_out_of_sync, /* prebuilt_exists: */ true); + String prebuilt_api_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(config); + String prebuilt_core_dll_path = prebuilt_api_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll"); + String prebuilt_editor_dll_path = prebuilt_api_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll"); + + if (!FileAccess::exists(prebuilt_core_dll_path) || !FileAccess::exists(prebuilt_editor_dll_path)) { + return FAIL_REASON(api_assembly_out_of_sync, /* prebuilt_exists: */ false); + } + + // Copy the prebuilt Api + if (!copy_prebuilt_api_assembly(APIAssembly::API_CORE, config) || + !copy_prebuilt_api_assembly(APIAssembly::API_EDITOR, config)) { + return FAIL_REASON(api_assembly_out_of_sync, /* prebuilt_exists: */ true); + } + } return String(); // Updated successfully diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index c5bcce4fa1..4f7d3791f7 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -165,7 +165,7 @@ public: #endif #ifdef TOOLS_ENABLED - bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type); + bool copy_prebuilt_api_assembly(APIAssembly::Type p_api_type, const String &p_config); String update_api_assemblies_from_prebuilt(); #endif |