Merge pull request #95885 from bruvzg/macos_arch

[macOS] Use per-architecture min. OS version for export.
This commit is contained in:
Rémi Verschelde 2024-09-06 11:11:01 +02:00
commit 2c733cbf1c
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 20 additions and 7 deletions

View file

@ -49,12 +49,17 @@ $usage_descriptions
<string>NSApplication</string> <string>NSApplication</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string>public.app-category.$app_category</string> <string>public.app-category.$app_category</string>
<key>LSMinimumSystemVersion</key> <key>LSArchitecturePriority</key>
<string>$min_version</string> <array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>LSMinimumSystemVersionByArchitecture</key> <key>LSMinimumSystemVersionByArchitecture</key>
<dict> <dict>
<key>arm64</key>
<string>$min_version_arm64</string>
<key>x86_64</key> <key>x86_64</key>
<string>$min_version</string> <string>$min_version_x86_64</string>
</dict> </dict>
<key>NSHighResolutionCapable</key> <key>NSHighResolutionCapable</key>
$highres $highres

View file

@ -38,8 +38,11 @@
<member name="application/icon_interpolation" type="int" setter="" getter=""> <member name="application/icon_interpolation" type="int" setter="" getter="">
Interpolation method used to resize application icon. Interpolation method used to resize application icon.
</member> </member>
<member name="application/min_macos_version" type="String" setter="" getter=""> <member name="application/min_macos_version_arm64" type="String" setter="" getter="">
Minimum version of macOS required for this application to run in the [code]major.minor.patch[/code] or [code]major.minor[/code] format, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]). Minimum version of macOS required for this application to run on Apple Silicon Macs, in the [code]major.minor.patch[/code] or [code]major.minor[/code] format, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]).
</member>
<member name="application/min_macos_version_x86_64" type="String" setter="" getter="">
Minimum version of macOS required for this application to run on Intel Macs, in the [code]major.minor.patch[/code] or [code]major.minor[/code] format, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]).
</member> </member>
<member name="application/short_version" type="String" setter="" getter=""> <member name="application/short_version" type="String" setter="" getter="">
Application version visible to the user, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]). Falls back to [member ProjectSettings.application/config/version] if left empty. Application version visible to the user, can only contain numeric characters ([code]0-9[/code]) and periods ([code].[/code]). Falls back to [member ProjectSettings.application/config/version] if left empty.

View file

@ -451,7 +451,8 @@ void EditorExportPlatformMacOS::get_export_options(List<ExportOption> *r_options
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version", PROPERTY_HINT_PLACEHOLDER_TEXT, "Leave empty to use project version"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version", PROPERTY_HINT_PLACEHOLDER_TEXT, "Leave empty to use project version"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::DICTIONARY, "application/copyright_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary())); r_options->push_back(ExportOption(PropertyInfo(Variant::DICTIONARY, "application/copyright_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary()));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/min_macos_version"), "10.12")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/min_macos_version_x86_64"), "10.12"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/min_macos_version_arm64"), "11.00"));
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/export_angle", PROPERTY_HINT_ENUM, "Auto,Yes,No"), 0, true)); r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/export_angle", PROPERTY_HINT_ENUM, "Auto,Yes,No"), 0, true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), true));
@ -823,8 +824,12 @@ void EditorExportPlatformMacOS::_fix_plist(const Ref<EditorExportPreset> &p_pres
strnew += lines[i].replace("$app_category", cat.to_lower()) + "\n"; strnew += lines[i].replace("$app_category", cat.to_lower()) + "\n";
} else if (lines[i].contains("$copyright")) { } else if (lines[i].contains("$copyright")) {
strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n"; strnew += lines[i].replace("$copyright", p_preset->get("application/copyright")) + "\n";
} else if (lines[i].contains("$min_version_arm64")) {
strnew += lines[i].replace("$min_version_arm64", p_preset->get("application/min_macos_version_arm64")) + "\n";
} else if (lines[i].contains("$min_version_x86_64")) {
strnew += lines[i].replace("$min_version_x86_64", p_preset->get("application/min_macos_version_x86_64")) + "\n";
} else if (lines[i].contains("$min_version")) { } else if (lines[i].contains("$min_version")) {
strnew += lines[i].replace("$min_version", p_preset->get("application/min_macos_version")) + "\n"; strnew += lines[i].replace("$min_version", p_preset->get("application/min_macos_version_x86_64")) + "\n"; // Old template, use x86-64 version for both.
} else if (lines[i].contains("$highres")) { } else if (lines[i].contains("$highres")) {
strnew += lines[i].replace("$highres", p_preset->get("display/high_res") ? "\t<true/>" : "\t<false/>") + "\n"; strnew += lines[i].replace("$highres", p_preset->get("display/high_res") ? "\t<true/>" : "\t<false/>") + "\n";
} else if (lines[i].contains("$additional_plist_content")) { } else if (lines[i].contains("$additional_plist_content")) {