summaryrefslogtreecommitdiff
path: root/modules/mono/godotsharp_dirs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/godotsharp_dirs.cpp')
-rw-r--r--modules/mono/godotsharp_dirs.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp
index 5fa8aed5a9..47eb432490 100644
--- a/modules/mono/godotsharp_dirs.cpp
+++ b/modules/mono/godotsharp_dirs.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,8 +39,8 @@
#include "editor/editor_settings.h"
#endif
-#ifdef __ANDROID__
-#include "utils/android_utils.h"
+#ifdef ANDROID_ENABLED
+#include "mono_gd/gd_mono_android.h"
#endif
#include "mono_gd/gd_mono.h"
@@ -108,6 +108,10 @@ public:
String data_editor_tools_dir;
String data_editor_prebuilt_api_dir;
+#else
+ // Equivalent of res_assemblies_dir, but in the data directory rather than in 'res://'.
+ // Only defined on export templates. Used when exporting assemblies outside of PCKs.
+ String data_game_assemblies_dir;
#endif
String data_mono_etc_dir;
@@ -130,7 +134,11 @@ private:
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());
+#ifdef JAVASCRIPT_ENABLED
+ mono_user_dir = "user://";
+#else
mono_user_dir = _get_mono_user_dir();
+#endif
mono_logs_dir = mono_user_dir.plus_file("mono_logs");
#ifdef TOOLS_ENABLED
@@ -160,8 +168,8 @@ private:
String data_mono_root_dir = data_dir_root.plus_file("Mono");
data_mono_etc_dir = data_mono_root_dir.plus_file("etc");
-#if __ANDROID__
- data_mono_lib_dir = GDMonoUtils::Android::get_app_native_lib_dir();
+#ifdef ANDROID_ENABLED
+ data_mono_lib_dir = GDMonoAndroid::get_app_native_lib_dir();
#else
data_mono_lib_dir = data_mono_root_dir.plus_file("lib");
#endif
@@ -197,10 +205,11 @@ private:
String data_mono_root_dir = data_dir_root.plus_file("Mono");
data_mono_etc_dir = data_mono_root_dir.plus_file("etc");
-#if __ANDROID__
- data_mono_lib_dir = GDMonoUtils::Android::get_app_native_lib_dir();
+#ifdef ANDROID_ENABLED
+ data_mono_lib_dir = GDMonoAndroid::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");
#endif
#ifdef WINDOWS_ENABLED
@@ -212,6 +221,10 @@ private:
data_mono_etc_dir = exe_dir.plus_file("../Resources/GodotSharp/Mono/etc");
data_mono_lib_dir = exe_dir.plus_file("../Frameworks/GodotSharp/Mono/lib");
}
+
+ if (!DirAccess::exists(data_game_assemblies_dir)) {
+ data_game_assemblies_dir = exe_dir.plus_file("../Frameworks/GodotSharp/Assemblies");
+ }
#endif
#endif
@@ -291,6 +304,10 @@ String get_data_editor_tools_dir() {
String get_data_editor_prebuilt_api_dir() {
return _GodotSharpDirs::get_singleton().data_editor_prebuilt_api_dir;
}
+#else
+String get_data_game_assemblies_dir() {
+ return _GodotSharpDirs::get_singleton().data_game_assemblies_dir;
+}
#endif
String get_data_mono_etc_dir() {