Repository: godotengine/godot
File: editor/export/editor_export_platform.cpp (C++)

Code before:
	}

	Error err = OS::get_singleton()->execute(scp_path, args, &out, &exit_code, true);
	if (err != OK) {
		return err;
	} else if (exit_code != 0) {
		if (!out.is_empty()) {
			print_line(out);
		}
		return FAILED;
	}
	return OK;
}

Array EditorExportPlatform::get_current_presets() const {
	Array ret;
	for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
		Ref<EditorExportPreset> ep = EditorExport::get_singleton()->get_export_preset(i);
		if (ep->get_platform() == this) {
			ret.push_back(ep);
		}
	}
	return ret;
}

Variant EditorExportPlatform::get_project_setting(const Ref<EditorExportPreset> &p_preset, const StringName &p_name) {
	if (p_preset.is_valid()) {
		Ref<EditorExportPlatform> platform = p_preset->get_platform();

		List<String> ftr_list;
		platform->get_platform_features(&ftr_list);
		platform->get_preset_features(p_preset, &ftr_list);

		Vector<String> features;
		for (const String &E : ftr_list) {
			features.push_back(E);
		}

		if (!p_preset->get_custom_features().is_empty()) {
			Vector<String> tmp_custom_list = p_preset->get_custom_features().split(",");

			for (int i = 0; i < tmp_custom_list.size(); i++) {
				String f = tmp_custom_list[i].strip_edges();
				if (!f.is_empty()) {
					features.push_back(f);
				}
			}
		}
		return ProjectSettings::get_singleton()->get_setting_with_override_with_custom_features(p_name, features);
	} else {
		return GLOBAL_GET(p_name);

Review comment (suggestion):
This method would really useful to have available to GDExtension, for use in `EditorExportPlugin`s. More specifically, in the [godot_openxr_vendor](https://github.com/GodotVR/godot_openxr_vendors) extension, it would allow us to eliminate some export settings for things we can know from project settings, but it's only safe to check with the feature tags for that specific export preset.

So, I think this should be exposed, either right on this class, or as a part of `EditorExportPreset`, or even a convenience method on `EditorExportPlugin` - whatever would make the nicest API

Code after:
	}

	Error err = OS::get_singleton()->execute(scp_path, args, &out, &exit_code, true);
	if (err != OK) {
		return err;
	} else if (exit_code != 0) {
		if (!out.is_empty()) {
			print_line(out);
		}
		return FAILED;
	}
	return OK;
}

Array EditorExportPlatform::get_current_presets() const {
	Array ret;
	for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
		Ref<EditorExportPreset> ep = EditorExport::get_singleton()->get_export_preset(i);
		if (ep->get_platform() == this) {
			ret.push_back(ep);
		}
	}
	return ret;
}

Variant EditorExportPlatform::get_project_setting(const Ref<EditorExportPreset> &p_preset, const StringName &p_name) {
	if (p_preset.is_valid()) {
		return p_preset->get_project_setting(p_name);
	} else {
		return GLOBAL_GET(p_name);
	}
}

void EditorExportPlatform::_bind_methods() {
	ClassDB::bind_method(D_METHOD("get_os_name"), &EditorExportPlatform::get_os_name);

	ClassDB::bind_method(D_METHOD("create_preset"), &EditorExportPlatform::create_preset);

	ClassDB::bind_method(D_METHOD("find_export_template", "template_file_name"), &EditorExportPlatform::_find_export_template);
	ClassDB::bind_method(D_METHOD("get_current_presets"), &EditorExportPlatform::get_current_presets);

	ClassDB::bind_method(D_METHOD("save_pack", "preset", "debug", "path", "embed"), &EditorExportPlatform::_save_pack, DEFVAL(false));
	ClassDB::bind_method(D_METHOD("save_zip", "preset", "debug", "path"), &EditorExportPlatform::_save_zip);
	ClassDB::bind_method(D_METHOD("save_pack_patch", "preset", "debug", "path"), &EditorExportPlatform::_save_pack_patch);
	ClassDB::bind_method(D_METHOD("save_zip_patch", "preset", "debug", "path"), &EditorExportPlatform::_save_zip_patch);

	ClassDB::bind_method(D_METHOD("gen_export_flags", "flags"), &EditorExportPlatform::gen_export_flags);

	ClassDB::bind_method(D_METHOD("export_project_files", "preset", "debug", "save_cb", "shared_cb"), &EditorExportPlatform::_export_project_files, DEFVAL(Callable()));

	ClassDB::bind_method(D_METHOD("export_project", "preset", "debug", "path", "flags"), &EditorExportPlatform::export_project, DEFVAL(0));