From 491077239c59469f958857e7f052aabfb6bef49c Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:22:46 +0200 Subject: [macOS/iOS export] Add option to set custom Info.plist data. --- platform/ios/export/export_plugin.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'platform/ios/export/export_plugin.cpp') diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 56fbfc31fc..395cd5d760 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -34,6 +34,7 @@ #include "run_icon_svg.gen.h" #include "core/io/json.h" +#include "core/io/plist.h" #include "core/string/translation.h" #include "editor/editor_node.h" #include "editor/editor_paths.h" @@ -154,6 +155,8 @@ void EditorExportPlatformIOS::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/min_ios_version"), "12.0")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/additional_plist_content", PROPERTY_HINT_MULTILINE_TEXT), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "application/icon_interpolation", PROPERTY_HINT_ENUM, "Nearest neighbor,Bilinear,Cubic,Trilinear,Lanczos"), 4)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "application/export_project_only"), false)); @@ -1498,6 +1501,8 @@ Error EditorExportPlatformIOS::_export_project_helper(const Refget("application/additional_plist_content").operator String() + "\n"; + Vector assets; Ref tmp_app_path = DirAccess::create_for_path(dest_dir); @@ -1867,6 +1872,26 @@ bool EditorExportPlatformIOS::has_valid_export_configuration(const Refget("application/additional_plist_content"); + if (!additional_plist_content.is_empty()) { + const String &plist = vformat("\n" + "" + "" + "\n" + "%s\n" + "\n" + "\n", + additional_plist_content); + + String plist_err; + Ref plist_parser; + plist_parser.instantiate(); + if (!plist_parser->load_string(plist, plist_err)) { + err += TTR("Invalid additional PList content: ") + plist_err + "\n"; + valid = false; + } + } + if (!err.is_empty()) { r_error = err; } -- cgit v1.2.3