EditorExportPlatform

继承: RefCounted < Object

派生: EditorExportPlatformAndroid, EditorExportPlatformExtension, EditorExportPlatformIOS, EditorExportPlatformMacOS, EditorExportPlatformPC, EditorExportPlatformWeb

Identifies a supported export platform, and internally provides the functionality of exporting to that platform.

描述

Base resource that provides the functionality of exporting a release build of a project to a platform, from the editor. Stores platform-specific metadata such as the name and supported features of the platform, and performs the exporting of projects, PCK files, and ZIP files. Uses an export template for the platform provided at the time of project exporting.

Used in scripting by EditorExportPlugin to configure platform-specific customization of scenes and resources. See EditorExportPlugin._begin_customize_scenes and EditorExportPlugin._begin_customize_resources for more details.

方法

voidadd_message ( type: ExportMessageType, category: String, message: String )
voidclear_messages ( )
EditorExportPresetcreate_preset ( )
Errorexport_pack ( preset: EditorExportPreset, debug: bool, path: String, flags: DebugFlags = 0 )
Errorexport_pack_patch ( preset: EditorExportPreset, debug: bool, path: String, patches: PackedStringArray = PackedStringArray(), flags: DebugFlags = 0 )
Errorexport_project ( preset: EditorExportPreset, debug: bool, path: String, flags: DebugFlags = 0 )
Errorexport_project_files ( preset: EditorExportPreset, debug: bool, save_cb: Callable, shared_cb: Callable = Callable() )
Errorexport_zip ( preset: EditorExportPreset, debug: bool, path: String, flags: DebugFlags = 0 )
Errorexport_zip_patch ( preset: EditorExportPreset, debug: bool, path: String, patches: PackedStringArray = PackedStringArray(), flags: DebugFlags = 0 )
Dictionaryfind_export_template ( template_file_name: String ) const1
PackedStringArraygen_export_flags ( flags: DebugFlags )
Arrayget_current_presets ( ) const1
PackedStringArrayget_forced_export_files ( ) static2
Stringget_message_category ( index: int ) const1
intget_message_count ( ) const1
Stringget_message_text ( index: int ) const1
ExportMessageTypeget_message_type ( index: int ) const1
Stringget_os_name ( ) const1
ExportMessageTypeget_worst_message_type ( ) const1
Dictionarysave_pack ( preset: EditorExportPreset, debug: bool, path: String, embed: bool = false )
Dictionarysave_pack_patch ( preset: EditorExportPreset, debug: bool, path: String )
Dictionarysave_zip ( preset: EditorExportPreset, debug: bool, path: String )
Dictionarysave_zip_patch ( preset: EditorExportPreset, debug: bool, path: String )
Errorssh_push_to_remote ( host: String, port: String, scp_args: PackedStringArray, src_file: String, dst_file: String ) const1
Errorssh_run_on_remote ( host: String, port: String, ssh_arg: PackedStringArray, cmd_args: String, output: Array = [], port_fwd: int = -1 ) const1
intssh_run_on_remote_no_wait ( host: String, port: String, ssh_args: PackedStringArray, cmd_args: String, port_fwd: int = -1 ) const1

枚举

enum ExportMessageType:

ExportMessageType EXPORT_MESSAGE_NONE = 0

Invalid message type used as the default value when no type is specified.

ExportMessageType EXPORT_MESSAGE_INFO = 1

Message type for informational messages that have no effect on the export.

ExportMessageType EXPORT_MESSAGE_WARNING = 2

Message type for warning messages that should be addressed but still allow to complete the export.

ExportMessageType EXPORT_MESSAGE_ERROR = 3

Message type for error messages that must be addressed and fail the export.


flags DebugFlags:

DebugFlags DEBUG_FLAG_DUMB_CLIENT = 1

Flag is set if remotely debugged project is expected to use remote file system. If set, gen_export_flags will add --remove-fs and --remote-fs-password (if password is set in the editor settings) command line arguments to the list.

DebugFlags DEBUG_FLAG_REMOTE_DEBUG = 2

Flag is set if remote debug is enabled. If set, gen_export_flags will add --remote-debug and --breakpoints (if breakpoints are selected in the script editor or added by the plugin) command line arguments to the list.

DebugFlags DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST = 4

Flag is set if remotely debugged project is running on the localhost. If set, gen_export_flags will use localhost instead of EditorSettings.network/debug/remote_host as remote debugger host.

DebugFlags DEBUG_FLAG_VIEW_COLLISIONS = 8

Flag is set if "Visible Collision Shapes" remote debug option is enabled. If set, gen_export_flags will add --debug-collisions command line arguments to the list.

DebugFlags DEBUG_FLAG_VIEW_NAVIGATION = 16

Flag is set if Visible Navigation" remote debug option is enabled. If set, gen_export_flags will add --debug-navigation command line arguments to the list.


方法说明

void add_message ( type: ExportMessageType, category: String, message: String )

Adds a message to the export log that will be displayed when exporting ends.


void clear_messages ( )

Clears the export log.


EditorExportPreset create_preset ( )

Create a new preset for this platform.


Error export_pack ( preset: EditorExportPreset, debug: bool, path: String, flags: DebugFlags = 0 )

Creates a PCK archive at path for the specified preset.


Error export_pack_patch ( preset: EditorExportPreset, debug: bool, path: String, patches: PackedStringArray = PackedStringArray(), flags: DebugFlags = 0 )

Creates a patch PCK archive at path for the specified preset, containing only the files that have changed since the last patch.

Note: patches is an optional override of the set of patches defined in the export preset. When empty the patches defined in the export preset will be used instead.


Error export_project ( preset: EditorExportPreset, debug: bool, path: String, flags: DebugFlags = 0 )

Creates a full project at path for the specified preset.


Error export_project_files ( preset: EditorExportPreset, debug: bool, save_cb: Callable, shared_cb: Callable = Callable() )

Exports project files for the specified preset. This method can be used to implement custom export format, other than PCK and ZIP. One of the callbacks is called for each exported file.

save_cb is called for all exported files and have the following arguments: file_path: String, file_data: PackedByteArray, file_index: int, file_count: int, encryption_include_filters: PackedStringArray, encryption_exclude_filters: PackedStringArray, encryption_key: PackedByteArray.

shared_cb is called for exported native shared/static libraries and have the following arguments: file_path: String, tags: PackedStringArray, target_folder: String.

Note: file_index and file_count are intended for progress tracking only and aren't necesserely unique and precise.


Error export_zip ( preset: EditorExportPreset, debug: bool, path: String, flags: DebugFlags = 0 )

Create a ZIP archive at path for the specified preset.


Error export_zip_patch ( preset: EditorExportPreset, debug: bool, path: String, patches: PackedStringArray = PackedStringArray(), flags: DebugFlags = 0 )

Create a patch ZIP archive at path for the specified preset, containing only the files that have changed since the last patch.

Note: patches is an optional override of the set of patches defined in the export preset. When empty the patches defined in the export preset will be used instead.


Dictionary find_export_template ( template_file_name: String ) const1

Locates export template for the platform, and returns Dictionary with the following keys: path: String and error: String. This method is provided for convenience and custom export platforms aren't required to use it or keep export templates stored in the same way official templates are.


PackedStringArray gen_export_flags ( flags: DebugFlags )

Generates array of command line arguments for the default export templates for the debug flags and editor settings.


Array get_current_presets ( ) const1

Returns array of EditorExportPreset s for this platform.


PackedStringArray get_forced_export_files ( ) static2

Returns array of core file names that always should be exported regardless of preset config.


String get_message_category ( index: int ) const1

Returns message category, for the message with index.


int get_message_count ( ) const1

Returns number of messages in the export log.


String get_message_text ( index: int ) const1

Returns message text, for the message with index.


ExportMessageType get_message_type ( index: int ) const1

Returns message type, for the message with index.


String get_os_name ( ) const1

Returns the name of the export operating system handled by this EditorExportPlatform class, as a friendly string. Possible return values are Windows, Linux, macOS, Android, iOS, and Web.


ExportMessageType get_worst_message_type ( ) const1

Returns most severe message type currently present in the export log.


Dictionary save_pack ( preset: EditorExportPreset, debug: bool, path: String, embed: bool = false )

Saves PCK archive and returns Dictionary with the following keys: result: Error, so_files: Array (array of the shared/static objects which contains dictionaries with the following keys: path: String, tags: PackedStringArray, and target_folder: String).

If embed is true, PCK content is appended to the end of path file and return Dictionary additionally include following keys: embedded_start: int (embedded PCK offset) and embedded_size: int (embedded PCK size).


Dictionary save_pack_patch ( preset: EditorExportPreset, debug: bool, path: String )

Saves patch PCK archive and returns Dictionary with the following keys: result: Error, so_files: Array (array of the shared/static objects which contains dictionaries with the following keys: path: String, tags: PackedStringArray, and target_folder: String).


Dictionary save_zip ( preset: EditorExportPreset, debug: bool, path: String )

Saves ZIP archive and returns Dictionary with the following keys: result: Error, so_files: Array (array of the shared/static objects which contains dictionaries with the following keys: path: String, tags: PackedStringArray, and target_folder: String).


Dictionary save_zip_patch ( preset: EditorExportPreset, debug: bool, path: String )

Saves patch ZIP archive and returns Dictionary with the following keys: result: Error, so_files: Array (array of the shared/static objects which contains dictionaries with the following keys: path: String, tags: PackedStringArray, and target_folder: String).


Error ssh_push_to_remote ( host: String, port: String, scp_args: PackedStringArray, src_file: String, dst_file: String ) const1

Uploads specified file over SCP protocol to the remote host.


Error ssh_run_on_remote ( host: String, port: String, ssh_arg: PackedStringArray, cmd_args: String, output: Array = [], port_fwd: int = -1 ) const1

Executes specified command on the remote host via SSH protocol and returns command output in the output.


int ssh_run_on_remote_no_wait ( host: String, port: String, ssh_args: PackedStringArray, cmd_args: String, port_fwd: int = -1 ) const1

Executes specified command on the remote host via SSH protocol and returns process ID (on the remote host) without waiting for command to finish.

3

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

4

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

5

本方法用于构造某个类型。

2

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。