summaryrefslogtreecommitdiffstats
path: root/platform/android/export/export_plugin.cpp
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@meta.com>2023-11-09 10:26:18 -0800
committerFredia Huya-Kouadio <fhuya@meta.com>2023-11-09 10:28:26 -0800
commit0325568a9bb9b9e33e5fe145b69cf3759aaa0027 (patch)
treee3e6a3c17329ac09be0a6d3cb9fc9892c352c416 /platform/android/export/export_plugin.cpp
parentd1381bbca264794eb3ba470789217ab6f5c91d3f (diff)
downloadredot-engine-0325568a9bb9b9e33e5fe145b69cf3759aaa0027.tar.gz
Update the validation logic for the package name:
- When using the project name, allow underscore (`_`) characters - Send a warning instead of an error when the project name is modified to fit the package name format
Diffstat (limited to 'platform/android/export/export_plugin.cpp')
-rw-r--r--platform/android/export/export_plugin.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index ffdca1e345..f325735e25 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -460,7 +460,7 @@ String EditorExportPlatformAndroid::get_valid_basename() const {
if (is_digit(c) && first) {
continue;
}
- if (is_ascii_alphanumeric_char(c)) {
+ if (is_ascii_identifier_char(c)) {
name += String::chr(c);
first = false;
}
@@ -537,13 +537,6 @@ bool EditorExportPlatformAndroid::is_package_name_valid(const String &p_package,
return false;
}
- if (p_package.find("$genname") >= 0 && !is_project_name_valid()) {
- if (r_error) {
- *r_error = TTR("The project name does not meet the requirement for the package name format. Please explicitly specify the package name.");
- }
- return false;
- }
-
return true;
}
@@ -2447,6 +2440,13 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref<Edit
err += "\n";
}
+ String package_name = p_preset->get("package/unique_name");
+ if (package_name.find("$genname") >= 0 && !is_project_name_valid()) {
+ // Warning only, so don't override `valid`.
+ err += vformat(TTR("The project name does not meet the requirement for the package name format and will be updated to \"%s\". Please explicitly specify the package name if needed."), get_valid_basename());
+ err += "\n";
+ }
+
r_error = err;
return valid;
}