Path: blob/master/editor/export/plugin_config_apple_embedded.h
9902 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` library39- **use_swift_runtime**: optional boolean field used to determine if Swift runtime is used4041The `dependencies` and fields are optional.42- **linked**: dependencies that should only be linked.43- **embedded**: dependencies that should be linked and embedded into application.44- **system**: system dependencies that should be linked.45- **capabilities**: capabilities that would be used for `UIRequiredDeviceCapabilities` options in Info.plist file.46- **files**: files that would be copied into application4748The `plist` section are optional.49- **key**: key and value that would be added in Info.plist file.50*/5152struct PluginConfigAppleEmbedded {53inline static const char *PLUGIN_CONFIG_EXT = ".gdip";5455inline static const char *CONFIG_SECTION = "config";56inline static const char *CONFIG_NAME_KEY = "name";57inline static const char *CONFIG_BINARY_KEY = "binary";58inline static const char *CONFIG_USE_SWIFT_KEY = "use_swift_runtime";59inline static const char *CONFIG_INITIALIZE_KEY = "initialization";60inline static const char *CONFIG_DEINITIALIZE_KEY = "deinitialization";6162inline static const char *DEPENDENCIES_SECTION = "dependencies";63inline static const char *DEPENDENCIES_LINKED_KEY = "linked";64inline static const char *DEPENDENCIES_EMBEDDED_KEY = "embedded";65inline static const char *DEPENDENCIES_SYSTEM_KEY = "system";66inline static const char *DEPENDENCIES_CAPABILITIES_KEY = "capabilities";67inline static const char *DEPENDENCIES_FILES_KEY = "files";68inline static const char *DEPENDENCIES_LINKER_FLAGS = "linker_flags";6970inline static const char *PLIST_SECTION = "plist";7172enum PlistItemType {73UNKNOWN,74STRING,75INTEGER,76BOOLEAN,77RAW,78STRING_INPUT,79};8081struct PlistItem {82PlistItemType type;83String value;84};8586// Set to true when the config file is properly loaded.87bool valid_config = false;88bool supports_targets = false;89// Unix timestamp of last change to this plugin.90uint64_t last_updated = 0;9192// Required config section93String name;94String binary;95bool use_swift_runtime;96String initialization_method;97String deinitialization_method;9899// Optional dependencies section100Vector<String> linked_dependencies;101Vector<String> embedded_dependencies;102Vector<String> system_dependencies;103104Vector<String> files_to_copy;105Vector<String> capabilities;106107Vector<String> linker_flags;108109// Optional plist section110// String value is default value.111// Currently supports `string`, `boolean`, `integer`, `raw`, `string_input` types112// <name>:<type> = <value>113HashMap<String, PlistItem> plist;114115static String resolve_local_dependency_path(String plugin_config_dir, String dependency_path);116117static String resolve_system_dependency_path(String dependency_path);118119static Vector<String> resolve_local_dependencies(String plugin_config_dir, Vector<String> p_paths);120121static Vector<String> resolve_system_dependencies(Vector<String> p_paths);122123static bool validate_plugin(PluginConfigAppleEmbedded &plugin_config);124125static String get_plugin_main_binary(PluginConfigAppleEmbedded &plugin_config, bool p_debug);126127static uint64_t get_plugin_modification_time(const PluginConfigAppleEmbedded &plugin_config, const String &config_path);128129static PluginConfigAppleEmbedded load_plugin_config(Ref<ConfigFile> config_file, const String &path);130};131132133