Path: blob/master/editor/export/plugin_config_apple_embedded.h
20951 views
/**************************************************************************/1/* plugin_config_apple_embedded.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/io/config_file.h"33#include "core/string/ustring.h"3435/*36The `config` section and fields are required and defined as follow:37- **name**: name of the plugin38- **binary**: path to static `.a` library3940The `dependencies` and fields are optional.41- **linked**: dependencies that should only be linked.42- **embedded**: dependencies that should be linked and embedded into application.43- **system**: system dependencies that should be linked.44- **capabilities**: capabilities that would be used for `UIRequiredDeviceCapabilities` options in Info.plist file.45- **files**: files that would be copied into application4647The `plist` section are optional.48- **key**: key and value that would be added in Info.plist file.49*/5051struct PluginConfigAppleEmbedded {52inline static const char *PLUGIN_CONFIG_EXT = ".gdip";5354inline static const char *CONFIG_SECTION = "config";55inline static const char *CONFIG_NAME_KEY = "name";56inline static const char *CONFIG_BINARY_KEY = "binary";57inline static const char *CONFIG_INITIALIZE_KEY = "initialization";58inline static const char *CONFIG_DEINITIALIZE_KEY = "deinitialization";5960inline static const char *DEPENDENCIES_SECTION = "dependencies";61inline static const char *DEPENDENCIES_LINKED_KEY = "linked";62inline static const char *DEPENDENCIES_EMBEDDED_KEY = "embedded";63inline static const char *DEPENDENCIES_SYSTEM_KEY = "system";64inline static const char *DEPENDENCIES_CAPABILITIES_KEY = "capabilities";65inline static const char *DEPENDENCIES_FILES_KEY = "files";66inline static const char *DEPENDENCIES_LINKER_FLAGS = "linker_flags";6768inline static const char *PLIST_SECTION = "plist";6970enum PlistItemType {71UNKNOWN,72STRING,73INTEGER,74BOOLEAN,75RAW,76STRING_INPUT,77};7879struct PlistItem {80PlistItemType type;81String value;82};8384// Set to true when the config file is properly loaded.85bool valid_config = false;86bool supports_targets = false;87// Unix timestamp of last change to this plugin.88uint64_t last_updated = 0;8990// Required config section91String name;92String binary;93String initialization_method;94String deinitialization_method;9596// Optional dependencies section97Vector<String> linked_dependencies;98Vector<String> embedded_dependencies;99Vector<String> system_dependencies;100101Vector<String> files_to_copy;102Vector<String> capabilities;103104Vector<String> linker_flags;105106// Optional plist section107// String value is default value.108// Currently supports `string`, `boolean`, `integer`, `raw`, `string_input` types109// <name>:<type> = <value>110HashMap<String, PlistItem> plist;111112static String resolve_local_dependency_path(String plugin_config_dir, String dependency_path);113114static String resolve_system_dependency_path(String dependency_path);115116static Vector<String> resolve_local_dependencies(String plugin_config_dir, Vector<String> p_paths);117118static Vector<String> resolve_system_dependencies(Vector<String> p_paths);119120static bool validate_plugin(PluginConfigAppleEmbedded &plugin_config);121122static String get_plugin_main_binary(PluginConfigAppleEmbedded &plugin_config, bool p_debug);123124static uint64_t get_plugin_modification_time(const PluginConfigAppleEmbedded &plugin_config, const String &config_path);125126static PluginConfigAppleEmbedded load_plugin_config(Ref<ConfigFile> config_file, const String &path);127};128129130