diff options
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/csharp_script.cpp | 4 | ||||
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 6 | ||||
-rw-r--r-- | modules/mono/editor/code_completion.cpp | 4 | ||||
-rw-r--r-- | modules/mono/editor/editor_internal_calls.cpp | 2 | ||||
-rw-r--r-- | modules/mono/godotsharp_dirs.cpp | 78 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 20 | ||||
-rw-r--r-- | modules/mono/utils/path_utils.cpp | 2 |
7 files changed, 58 insertions, 58 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 8b135051c5..2e59987fe6 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -694,7 +694,7 @@ bool CSharpLanguage::is_assembly_reloading_needed() { } assembly_path = GodotSharpDirs::get_res_temp_assemblies_dir() - .plus_file(assembly_name + ".dll"); + .path_join(assembly_name + ".dll"); assembly_path = ProjectSettings::get_singleton()->globalize_path(assembly_path); if (!FileAccess::exists(assembly_path)) { @@ -1085,7 +1085,7 @@ void CSharpLanguage::_editor_init_callback() { const void **interop_funcs = godotsharp::get_editor_interop_funcs(interop_funcs_size); Object *editor_plugin_obj = GDMono::get_singleton()->get_plugin_callbacks().LoadToolsAssemblyCallback( - GodotSharpDirs::get_data_editor_tools_dir().plus_file("GodotTools.dll").utf16(), + GodotSharpDirs::get_data_editor_tools_dir().path_join("GodotTools.dll").utf16(), interop_funcs, interop_funcs_size); CRASH_COND(editor_plugin_obj == nullptr); diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index d70a1e6c88..0e496454a1 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -1315,7 +1315,7 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { // Generate GodotSharp source files - String core_proj_dir = output_dir.plus_file(CORE_API_ASSEMBLY_NAME); + String core_proj_dir = output_dir.path_join(CORE_API_ASSEMBLY_NAME); proj_err = generate_cs_core_project(core_proj_dir); if (proj_err != OK) { @@ -1325,7 +1325,7 @@ Error BindingsGenerator::generate_cs_api(const String &p_output_dir) { // Generate GodotSharpEditor source files - String editor_proj_dir = output_dir.plus_file(EDITOR_API_ASSEMBLY_NAME); + String editor_proj_dir = output_dir.path_join(EDITOR_API_ASSEMBLY_NAME); proj_err = generate_cs_editor_project(editor_proj_dir); if (proj_err != OK) { @@ -3880,7 +3880,7 @@ static void handle_cmdline_options(String glue_dir_path) { CRASH_COND(glue_dir_path.is_empty()); - if (bindings_generator.generate_cs_api(glue_dir_path.plus_file(API_SOLUTION_NAME)) != OK) { + if (bindings_generator.generate_cs_api(glue_dir_path.path_join(API_SOLUTION_NAME)) != OK) { ERR_PRINT(generate_all_glue_option + ": Failed to generate the C# API."); } } diff --git a/modules/mono/editor/code_completion.cpp b/modules/mono/editor/code_completion.cpp index 36c46627e2..40296eef10 100644 --- a/modules/mono/editor/code_completion.cpp +++ b/modules/mono/editor/code_completion.cpp @@ -163,9 +163,9 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr } if (dir_access->dir_exists(filename)) { - directories.push_back(dir_access->get_current_dir().plus_file(filename)); + directories.push_back(dir_access->get_current_dir().path_join(filename)); } else if (filename.ends_with(".tscn") || filename.ends_with(".scn")) { - suggestions.push_back(quoted(dir_access->get_current_dir().plus_file(filename))); + suggestions.push_back(quoted(dir_access->get_current_dir().path_join(filename))); } filename = dir_access->get_next(); diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index 1ef78c3ac2..6f42ad6916 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -98,7 +98,7 @@ bool godot_icall_EditorProgress_Step(const godot_string *p_task, const godot_str } void godot_icall_Internal_FullExportTemplatesDir(godot_string *r_dest) { - String full_templates_dir = EditorPaths::get_singleton()->get_export_templates_dir().plus_file(VERSION_FULL_CONFIG); + String full_templates_dir = EditorPaths::get_singleton()->get_export_templates_dir().path_join(VERSION_FULL_CONFIG); memnew_placement(r_dest, String(full_templates_dir)); } diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp index 12960fb938..c7e47d2718 100644 --- a/modules/mono/godotsharp_dirs.cpp +++ b/modules/mono/godotsharp_dirs.cpp @@ -64,7 +64,7 @@ String _get_expected_build_config() { String _get_mono_user_dir() { #ifdef TOOLS_ENABLED if (EditorPaths::get_singleton()) { - return EditorPaths::get_singleton()->get_data_dir().plus_file("mono"); + return EditorPaths::get_singleton()->get_data_dir().path_join("mono"); } else { String settings_path; @@ -72,23 +72,23 @@ String _get_mono_user_dir() { String exe_dir = OS::get_singleton()->get_executable_path().get_base_dir(); // On macOS, look outside .app bundle, since .app bundle is read-only. - if (OS::get_singleton()->has_feature("macos") && exe_dir.ends_with("MacOS") && exe_dir.plus_file("..").simplify_path().ends_with("Contents")) { - exe_dir = exe_dir.plus_file("../../..").simplify_path(); + if (OS::get_singleton()->has_feature("macos") && exe_dir.ends_with("MacOS") && exe_dir.path_join("..").simplify_path().ends_with("Contents")) { + exe_dir = exe_dir.path_join("../../..").simplify_path(); } Ref<DirAccess> d = DirAccess::create_for_path(exe_dir); if (d->file_exists("._sc_") || d->file_exists("_sc_")) { // contain yourself - settings_path = exe_dir.plus_file("editor_data"); + settings_path = exe_dir.path_join("editor_data"); } else { - settings_path = OS::get_singleton()->get_data_path().plus_file(OS::get_singleton()->get_godot_dir_name()); + settings_path = OS::get_singleton()->get_data_path().path_join(OS::get_singleton()->get_godot_dir_name()); } - return settings_path.plus_file("mono"); + return settings_path.path_join("mono"); } #else - return OS::get_singleton()->get_user_data_dir().plus_file("mono"); + return OS::get_singleton()->get_user_data_dir().path_join("mono"); #endif } @@ -126,27 +126,27 @@ public: private: _GodotSharpDirs() { - res_data_dir = ProjectSettings::get_singleton()->get_project_data_path().plus_file("mono"); - res_metadata_dir = res_data_dir.plus_file("metadata"); - res_config_dir = res_data_dir.plus_file("etc").plus_file("mono"); + res_data_dir = ProjectSettings::get_singleton()->get_project_data_path().path_join("mono"); + res_metadata_dir = res_data_dir.path_join("metadata"); + res_config_dir = res_data_dir.path_join("etc").path_join("mono"); // TODO use paths from csproj - res_temp_dir = res_data_dir.plus_file("temp"); - res_temp_assemblies_base_dir = res_temp_dir.plus_file("bin"); - res_temp_assemblies_dir = res_temp_assemblies_base_dir.plus_file(_get_expected_build_config()); + res_temp_dir = res_data_dir.path_join("temp"); + res_temp_assemblies_base_dir = res_temp_dir.path_join("bin"); + res_temp_assemblies_dir = res_temp_assemblies_base_dir.path_join(_get_expected_build_config()); - api_assemblies_base_dir = res_data_dir.plus_file("assemblies"); + api_assemblies_base_dir = res_data_dir.path_join("assemblies"); #ifdef WEB_ENABLED mono_user_dir = "user://"; #else mono_user_dir = _get_mono_user_dir(); #endif - mono_logs_dir = mono_user_dir.plus_file("mono_logs"); + mono_logs_dir = mono_user_dir.path_join("mono_logs"); #ifdef TOOLS_ENABLED - mono_solutions_dir = mono_user_dir.plus_file("solutions"); - build_logs_dir = mono_user_dir.plus_file("build_logs"); + mono_solutions_dir = mono_user_dir.path_join("solutions"); + build_logs_dir = mono_user_dir.path_join("build_logs"); String base_path = ProjectSettings::get_singleton()->globalize_path("res://"); #endif @@ -155,35 +155,35 @@ private: #ifdef TOOLS_ENABLED - String data_dir_root = exe_dir.plus_file("GodotSharp"); - data_editor_tools_dir = data_dir_root.plus_file("Tools"); - api_assemblies_base_dir = data_dir_root.plus_file("Api"); + String data_dir_root = exe_dir.path_join("GodotSharp"); + data_editor_tools_dir = data_dir_root.path_join("Tools"); + api_assemblies_base_dir = data_dir_root.path_join("Api"); - String data_mono_root_dir = data_dir_root.plus_file("Mono"); - data_mono_etc_dir = data_mono_root_dir.plus_file("etc"); + String data_mono_root_dir = data_dir_root.path_join("Mono"); + data_mono_etc_dir = data_mono_root_dir.path_join("etc"); #ifdef ANDROID_ENABLED data_mono_lib_dir = gdmono::android::support::get_app_native_lib_dir(); #else - data_mono_lib_dir = data_mono_root_dir.plus_file("lib"); + data_mono_lib_dir = data_mono_root_dir.path_join("lib"); #endif #ifdef WINDOWS_ENABLED - data_mono_bin_dir = data_mono_root_dir.plus_file("bin"); + data_mono_bin_dir = data_mono_root_dir.path_join("bin"); #endif #ifdef MACOS_ENABLED if (!DirAccess::exists(data_editor_tools_dir)) { - data_editor_tools_dir = exe_dir.plus_file("../Resources/GodotSharp/Tools"); + data_editor_tools_dir = exe_dir.path_join("../Resources/GodotSharp/Tools"); } if (!DirAccess::exists(api_assemblies_base_dir)) { - api_assemblies_base_dir = exe_dir.plus_file("../Resources/GodotSharp/Api"); + api_assemblies_base_dir = exe_dir.path_join("../Resources/GodotSharp/Api"); } if (!DirAccess::exists(data_mono_root_dir)) { - data_mono_etc_dir = exe_dir.plus_file("../Resources/GodotSharp/Mono/etc"); - data_mono_lib_dir = exe_dir.plus_file("../Resources/GodotSharp/Mono/lib"); + data_mono_etc_dir = exe_dir.path_join("../Resources/GodotSharp/Mono/etc"); + data_mono_lib_dir = exe_dir.path_join("../Resources/GodotSharp/Mono/lib"); } #endif @@ -191,40 +191,40 @@ private: String appname = ProjectSettings::get_singleton()->get("application/config/name"); String appname_safe = OS::get_singleton()->get_safe_dir_name(appname); - String data_dir_root = exe_dir.plus_file("data_" + appname_safe); + String data_dir_root = exe_dir.path_join("data_" + appname_safe); if (!DirAccess::exists(data_dir_root)) { - data_dir_root = exe_dir.plus_file("data_Godot"); + data_dir_root = exe_dir.path_join("data_Godot"); } - String data_mono_root_dir = data_dir_root.plus_file("Mono"); - data_mono_etc_dir = data_mono_root_dir.plus_file("etc"); + String data_mono_root_dir = data_dir_root.path_join("Mono"); + data_mono_etc_dir = data_mono_root_dir.path_join("etc"); #ifdef ANDROID_ENABLED data_mono_lib_dir = gdmono::android::support::get_app_native_lib_dir(); #else - data_mono_lib_dir = data_mono_root_dir.plus_file("lib"); - data_game_assemblies_dir = data_dir_root.plus_file("Assemblies"); + data_mono_lib_dir = data_mono_root_dir.path_join("lib"); + data_game_assemblies_dir = data_dir_root.path_join("Assemblies"); #endif #ifdef WINDOWS_ENABLED - data_mono_bin_dir = data_mono_root_dir.plus_file("bin"); + data_mono_bin_dir = data_mono_root_dir.path_join("bin"); #endif #ifdef MACOS_ENABLED if (!DirAccess::exists(data_mono_root_dir)) { - data_mono_etc_dir = exe_dir.plus_file("../Resources/GodotSharp/Mono/etc"); - data_mono_lib_dir = exe_dir.plus_file("../Resources/GodotSharp/Mono/lib"); + data_mono_etc_dir = exe_dir.path_join("../Resources/GodotSharp/Mono/etc"); + data_mono_lib_dir = exe_dir.path_join("../Resources/GodotSharp/Mono/lib"); } if (!DirAccess::exists(data_game_assemblies_dir)) { - data_game_assemblies_dir = exe_dir.plus_file("../Resources/GodotSharp/Assemblies"); + data_game_assemblies_dir = exe_dir.path_join("../Resources/GodotSharp/Assemblies"); } #endif #endif #ifdef TOOLS_ENABLED - api_assemblies_dir = api_assemblies_base_dir.plus_file(GDMono::get_expected_api_build_config()); + api_assemblies_dir = api_assemblies_base_dir.path_join(GDMono::get_expected_api_build_config()); #else api_assemblies_dir = data_dir_root; #endif diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index eda4924f15..e698e92d7a 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -173,13 +173,13 @@ String find_hostfxr() { #if defined(WINDOWS_ENABLED) String probe_path = GodotSharpDirs::get_api_assemblies_dir() - .plus_file("hostfxr.dll"); + .path_join("hostfxr.dll"); #elif defined(MACOS_ENABLED) String probe_path = GodotSharpDirs::get_api_assemblies_dir() - .plus_file("libhostfxr.dylib"); + .path_join("libhostfxr.dylib"); #elif defined(UNIX_ENABLED) String probe_path = GodotSharpDirs::get_api_assemblies_dir() - .plus_file("libhostfxr.so"); + .path_join("libhostfxr.so"); #else #error "Platform not supported (yet?)" #endif @@ -305,10 +305,10 @@ godot_plugins_initialize_fn initialize_hostfxr_and_godot_plugins(bool &r_runtime godot_plugins_initialize_fn godot_plugins_initialize = nullptr; HostFxrCharString godot_plugins_path = str_to_hostfxr( - GodotSharpDirs::get_api_assemblies_dir().plus_file("GodotPlugins.dll")); + GodotSharpDirs::get_api_assemblies_dir().path_join("GodotPlugins.dll")); HostFxrCharString config_path = str_to_hostfxr( - GodotSharpDirs::get_api_assemblies_dir().plus_file("GodotPlugins.runtimeconfig.json")); + GodotSharpDirs::get_api_assemblies_dir().path_join("GodotPlugins.runtimeconfig.json")); load_assembly_and_get_function_pointer_fn load_assembly_and_get_function_pointer = initialize_hostfxr_for_config(get_data(config_path)); @@ -345,7 +345,7 @@ godot_plugins_initialize_fn initialize_hostfxr_and_godot_plugins(bool &r_runtime String assembly_name = get_assembly_name(); HostFxrCharString assembly_path = str_to_hostfxr(GodotSharpDirs::get_api_assemblies_dir() - .plus_file(assembly_name + ".dll")); + .path_join(assembly_name + ".dll")); load_assembly_and_get_function_pointer_fn load_assembly_and_get_function_pointer = initialize_hostfxr_self_contained(get_data(assembly_path)); @@ -370,11 +370,11 @@ godot_plugins_initialize_fn try_load_native_aot_library(void *&r_aot_dll_handle) String assembly_name = get_assembly_name(); #if defined(WINDOWS_ENABLED) - String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().plus_file(assembly_name + ".dll"); + String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().path_join(assembly_name + ".dll"); #elif defined(MACOS_ENABLED) - String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().plus_file(assembly_name + ".dylib"); + String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().path_join(assembly_name + ".dylib"); #elif defined(UNIX_ENABLED) - String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().plus_file(assembly_name + ".so"); + String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().path_join(assembly_name + ".so"); #else #error "Platform not supported (yet?)" #endif @@ -514,7 +514,7 @@ bool GDMono::_load_project_assembly() { } String assembly_path = GodotSharpDirs::get_res_temp_assemblies_dir() - .plus_file(assembly_name + ".dll"); + .path_join(assembly_name + ".dll"); assembly_path = ProjectSettings::get_singleton()->globalize_path(assembly_path); if (!FileAccess::exists(assembly_path)) { diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index 19ad59a1bc..269e41e2f4 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -205,7 +205,7 @@ String relative_to_impl(const String &p_path, const String &p_relative_to) { return p_path; } - return String("..").plus_file(relative_to_impl(p_path, base_dir)); + return String("..").path_join(relative_to_impl(p_path, base_dir)); } } |