1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Merge pull request #84676 from m4gr3d/update_package_name_validation_logic

Update the validation logic for the package name
This commit is contained in:
Yuri Sizov
2023-12-08 15:23:23 +01:00

View File

@@ -460,7 +460,7 @@ String EditorExportPlatformAndroid::get_valid_basename() const {
if (is_digit(c) && first) { if (is_digit(c) && first) {
continue; continue;
} }
if (is_ascii_alphanumeric_char(c)) { if (is_ascii_identifier_char(c)) {
name += String::chr(c); name += String::chr(c);
first = false; first = false;
} }
@@ -537,13 +537,6 @@ bool EditorExportPlatformAndroid::is_package_name_valid(const String &p_package,
return false; 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; return true;
} }
@@ -2446,6 +2439,13 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref<Edit
err += "\n"; 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; r_error = err;
return valid; return valid;
} }