summaryrefslogtreecommitdiffstats
path: root/platform/android/export/gradle_export_util.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-17 00:23:32 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-17 00:23:32 +0100
commit66b33c15e42005bfd4c60c4c50805a0aaf5a2c80 (patch)
tree800a638ac75e389dfac0aa3ca873eaab48ce7673 /platform/android/export/gradle_export_util.cpp
parentc28493ad048f65bdcd62f6be7558fa7b442ea801 (diff)
parenta37ad265dc818d2aeaec97e1559ecae42e5487e2 (diff)
downloadredot-engine-66b33c15e42005bfd4c60c4c50805a0aaf5a2c80.tar.gz
Merge pull request #88297 from dsnopek/android-configure-gradle-path
Android: Allow using alternative Gradle build directory
Diffstat (limited to 'platform/android/export/gradle_export_util.cpp')
-rw-r--r--platform/android/export/gradle_export_util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp
index 0915009235..9eddef6a4c 100644
--- a/platform/android/export/gradle_export_util.cpp
+++ b/platform/android/export/gradle_export_util.cpp
@@ -191,14 +191,14 @@ String _android_xml_escape(const String &p_string) {
}
// Creates strings.xml files inside the gradle project for different locales.
-Error _create_project_name_strings_files(const Ref<EditorExportPreset> &p_preset, const String &project_name) {
+Error _create_project_name_strings_files(const Ref<EditorExportPreset> &p_preset, const String &project_name, const String &p_gradle_build_dir) {
print_verbose("Creating strings resources for supported locales for project " + project_name);
// Stores the string into the default values directory.
String processed_default_xml_string = vformat(godot_project_name_xml_string, _android_xml_escape(project_name));
- store_string_at_path("res://android/build/res/values/godot_project_name_string.xml", processed_default_xml_string);
+ store_string_at_path(p_gradle_build_dir.path_join("res/values/godot_project_name_string.xml"), processed_default_xml_string);
// Searches the Gradle project res/ directory to find all supported locales
- Ref<DirAccess> da = DirAccess::open("res://android/build/res");
+ Ref<DirAccess> da = DirAccess::open(p_gradle_build_dir.path_join("res"));
if (da.is_null()) {
if (OS::get_singleton()->is_stdout_verbose()) {
print_error("Unable to open Android resources directory.");
@@ -217,7 +217,7 @@ Error _create_project_name_strings_files(const Ref<EditorExportPreset> &p_preset
continue;
}
String locale = file.replace("values-", "").replace("-r", "_");
- String locale_directory = "res://android/build/res/" + file + "/godot_project_name_string.xml";
+ String locale_directory = p_gradle_build_dir.path_join("res/" + file + "/godot_project_name_string.xml");
if (appnames.has(locale)) {
String locale_project_name = appnames[locale];
String processed_xml_string = vformat(godot_project_name_xml_string, _android_xml_escape(locale_project_name));