summaryrefslogtreecommitdiff
path: root/platform/iphone/export
diff options
context:
space:
mode:
Diffstat (limited to 'platform/iphone/export')
-rw-r--r--platform/iphone/export/export_plugin.cpp31
-rw-r--r--platform/iphone/export/export_plugin.h2
2 files changed, 18 insertions, 15 deletions
diff --git a/platform/iphone/export/export_plugin.cpp b/platform/iphone/export/export_plugin.cpp
index 69a8203e9f..247b456b26 100644
--- a/platform/iphone/export/export_plugin.cpp
+++ b/platform/iphone/export/export_plugin.cpp
@@ -33,7 +33,7 @@
void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name");
r_features->push_back("pvrtc");
- if (driver == "Vulkan") {
+ if (driver == "vulkan") {
// FIXME: Review if this is correct.
r_features->push_back("etc2");
}
@@ -728,10 +728,10 @@ Error EditorExportPlatformIOS::_export_loading_screen_images(const Ref<EditorExp
Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler p_handler, void *p_userdata) {
Vector<String> dirs;
- String path;
String current_dir = p_da->get_current_dir();
p_da->list_dir_begin();
- while ((path = p_da->get_next()).length() != 0) {
+ String path = p_da->get_next();
+ while (!path.is_empty()) {
if (p_da->current_is_dir()) {
if (path != "." && path != "..") {
dirs.push_back(path);
@@ -743,6 +743,7 @@ Error EditorExportPlatformIOS::_walk_dir_recursive(DirAccess *p_da, FileHandler
return err;
}
}
+ path = p_da->get_next();
}
p_da->list_dir_end();
@@ -841,7 +842,7 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese
String pbx_embeded_frameworks;
const String file_info_format = String("$build_id = {isa = PBXBuildFile; fileRef = $ref_id; };\n") +
- "$ref_id = {isa = PBXFileReference; lastKnownFileType = $file_type; name = \"$name\"; path = \"$file_path\"; sourceTree = \"<group>\"; };\n";
+ "$ref_id = {isa = PBXFileReference; lastKnownFileType = $file_type; name = \"$name\"; path = \"$file_path\"; sourceTree = \"<group>\"; };\n";
for (int i = 0; i < p_additional_assets.size(); ++i) {
String additional_asset_info_format = file_info_format;
@@ -1105,7 +1106,7 @@ Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir
for (int j = 0; j < project_static_libs.size(); j++) {
project_static_libs.write[j] = project_static_libs[j].get_file(); // Only the file name as it's copied to the project
}
- err = _export_additional_assets(p_out_dir, project_static_libs, true, true, r_exported_assets);
+ err = _export_additional_assets(p_out_dir, project_static_libs, true, false, r_exported_assets);
ERR_FAIL_COND_V(err, err);
Vector<String> ios_bundle_files = export_plugins[i]->get_ios_bundle_files();
@@ -1261,8 +1262,8 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset>
String deinitialization_method = plugin.deinitialization_method + "();\n";
plugin_definition_cpp_code += definition_comment +
- "extern void " + initialization_method +
- "extern void " + deinitialization_method + "\n";
+ "extern void " + initialization_method +
+ "extern void " + deinitialization_method + "\n";
plugin_initialization_cpp_code += "\t" + initialization_method;
plugin_deinitialization_cpp_code += "\t" + deinitialization_method;
@@ -1362,10 +1363,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
src_pkg_name = p_preset->get("custom_template/release");
}
- if (src_pkg_name == "") {
+ if (src_pkg_name.is_empty()) {
String err;
src_pkg_name = find_export_template("iphone.zip", &err);
- if (src_pkg_name == "") {
+ if (src_pkg_name.is_empty()) {
EditorNode::add_io_error(err);
return ERR_FILE_NOT_FOUND;
}
@@ -1427,7 +1428,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
}
bool found_library = false;
- int total_size = 0;
const String project_file = "godot_ios.xcodeproj/project.pbxproj";
Set<String> files_to_parse;
@@ -1523,7 +1523,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
file = file.replace("godot_ios", binary_name);
print_line("ADDING: " + file + " size: " + itos(data.size()));
- total_size += data.size();
/* write it into our folder structure */
file = dest_dir + file;
@@ -1687,8 +1686,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
archive_args.push_back("archive");
archive_args.push_back("-archivePath");
archive_args.push_back(archive_path);
- err = OS::get_singleton()->execute("xcodebuild", archive_args);
+ String archive_str;
+ err = OS::get_singleton()->execute("xcodebuild", archive_args, &archive_str, nullptr, true);
ERR_FAIL_COND_V(err, err);
+ print_line("xcodebuild (.xcarchive):\n" + archive_str);
if (ep.step("Making .ipa", 4)) {
return ERR_SKIP;
@@ -1702,8 +1703,10 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
export_args.push_back("-allowProvisioningUpdates");
export_args.push_back("-exportPath");
export_args.push_back(dest_dir);
- err = OS::get_singleton()->execute("xcodebuild", export_args);
+ String export_str;
+ err = OS::get_singleton()->execute("xcodebuild", export_args, &export_str, nullptr, true);
ERR_FAIL_COND_V(err, err);
+ print_line("xcodebuild (.ipa):\n" + export_str);
#else
print_line(".ipa can only be built on macOS. Leaving Xcode project without building the package.");
#endif
@@ -1764,7 +1767,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
}
String etc_error = test_etc2_or_pvrtc();
- if (etc_error != String()) {
+ if (!etc_error.is_empty()) {
valid = false;
err += etc_error;
}
diff --git a/platform/iphone/export/export_plugin.h b/platform/iphone/export/export_plugin.h
index 8d3af6e057..359f855d86 100644
--- a/platform/iphone/export/export_plugin.h
+++ b/platform/iphone/export/export_plugin.h
@@ -204,7 +204,7 @@ public:
virtual void get_platform_features(List<String> *r_features) override {
r_features->push_back("mobile");
- r_features->push_back("iOS");
+ r_features->push_back("ios");
}
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) override {