Class EditorExportPlatform
- Namespace
- Godot
- Assembly
- GodotSharpEditor.dll
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 _BeginCustomizeScenes(EditorExportPlatform, string[]) and _BeginCustomizeResources(EditorExportPlatform, string[]) for more details.
public class EditorExportPlatform : RefCounted, IDisposable
- Inheritance
-
EditorExportPlatform
- Implements
- Derived
- Inherited Members
Methods
AddMessage(ExportMessageType, string, string)
Adds a message to the export log that will be displayed when exporting ends.
public void AddMessage(EditorExportPlatform.ExportMessageType type, string category, string message)
Parameters
type
EditorExportPlatform.ExportMessageTypecategory
stringmessage
string
ClearMessages()
Clears the export log.
public void ClearMessages()
CreatePreset()
Create a new preset for this platform.
public EditorExportPreset CreatePreset()
Returns
ExportPack(EditorExportPreset, bool, string, DebugFlags)
Creates a PCK archive at path
for the specified preset
.
public Error ExportPack(EditorExportPreset preset, bool debug, string path, EditorExportPlatform.DebugFlags flags = (EditorExportPlatform.DebugFlags)0)
Parameters
preset
EditorExportPresetdebug
boolpath
stringflags
EditorExportPlatform.DebugFlags
Returns
ExportPackPatch(EditorExportPreset, bool, string, ReadOnlySpan<string>, DebugFlags)
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.
public Error ExportPackPatch(EditorExportPreset preset, bool debug, string path, ReadOnlySpan<string> patches, EditorExportPlatform.DebugFlags flags)
Parameters
preset
EditorExportPresetdebug
boolpath
stringpatches
ReadOnlySpan<string>flags
EditorExportPlatform.DebugFlags
Returns
ExportPackPatch(EditorExportPreset, bool, string, string[], DebugFlags)
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.
public Error ExportPackPatch(EditorExportPreset preset, bool debug, string path, string[] patches = null, EditorExportPlatform.DebugFlags flags = (EditorExportPlatform.DebugFlags)0)
Parameters
preset
EditorExportPresetdebug
boolpath
stringpatches
string[]If the parameter is null, then the default value is
Array.Empty<string>()
.flags
EditorExportPlatform.DebugFlags
Returns
ExportProject(EditorExportPreset, bool, string, DebugFlags)
Creates a full project at path
for the specified preset
.
public Error ExportProject(EditorExportPreset preset, bool debug, string path, EditorExportPlatform.DebugFlags flags = (EditorExportPlatform.DebugFlags)0)
Parameters
preset
EditorExportPresetdebug
boolpath
stringflags
EditorExportPlatform.DebugFlags
Returns
ExportProjectFiles(EditorExportPreset, bool, 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.
saveCb
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
.
sharedCb
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 necessarily unique and precise.
public Error ExportProjectFiles(EditorExportPreset preset, bool debug, Callable saveCb, Callable sharedCb = default)
Parameters
preset
EditorExportPresetdebug
boolsaveCb
CallablesharedCb
Callable
Returns
ExportZip(EditorExportPreset, bool, string, DebugFlags)
Create a ZIP archive at path
for the specified preset
.
public Error ExportZip(EditorExportPreset preset, bool debug, string path, EditorExportPlatform.DebugFlags flags = (EditorExportPlatform.DebugFlags)0)
Parameters
preset
EditorExportPresetdebug
boolpath
stringflags
EditorExportPlatform.DebugFlags
Returns
ExportZipPatch(EditorExportPreset, bool, string, ReadOnlySpan<string>, DebugFlags)
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.
public Error ExportZipPatch(EditorExportPreset preset, bool debug, string path, ReadOnlySpan<string> patches, EditorExportPlatform.DebugFlags flags)
Parameters
preset
EditorExportPresetdebug
boolpath
stringpatches
ReadOnlySpan<string>flags
EditorExportPlatform.DebugFlags
Returns
ExportZipPatch(EditorExportPreset, bool, string, string[], DebugFlags)
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.
public Error ExportZipPatch(EditorExportPreset preset, bool debug, string path, string[] patches = null, EditorExportPlatform.DebugFlags flags = (EditorExportPlatform.DebugFlags)0)
Parameters
preset
EditorExportPresetdebug
boolpath
stringpatches
string[]If the parameter is null, then the default value is
Array.Empty<string>()
.flags
EditorExportPlatform.DebugFlags
Returns
FindExportTemplate(string)
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.
public Dictionary FindExportTemplate(string templateFileName)
Parameters
templateFileName
string
Returns
GenExportFlags(DebugFlags)
Generates array of command line arguments for the default export templates for the debug flags and editor settings.
public string[] GenExportFlags(EditorExportPlatform.DebugFlags flags)
Parameters
Returns
- string[]
GetCurrentPresets()
Returns array of EditorExportPresets for this platform.
public Array GetCurrentPresets()
Returns
GetForcedExportFiles()
Returns array of core file names that always should be exported regardless of preset config.
public static string[] GetForcedExportFiles()
Returns
- string[]
GetInternalExportFiles(EditorExportPreset, bool)
Returns additional files that should always be exported regardless of preset configuration, and are not part of the project source. The returned Dictionary contains filename keys (string) and their corresponding raw data (byte[]).
public Dictionary GetInternalExportFiles(EditorExportPreset preset, bool debug)
Parameters
preset
EditorExportPresetdebug
bool
Returns
GetMessageCategory(int)
Returns message category, for the message with index
.
public string GetMessageCategory(int index)
Parameters
index
int
Returns
GetMessageCount()
Returns number of messages in the export log.
public int GetMessageCount()
Returns
GetMessageText(int)
Returns message text, for the message with index
.
public string GetMessageText(int index)
Parameters
index
int
Returns
GetMessageType(int)
Returns message type, for the message with index
.
public EditorExportPlatform.ExportMessageType GetMessageType(int index)
Parameters
index
int
Returns
GetOsName()
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
.
public string GetOsName()
Returns
GetWorstMessageType()
Returns most severe message type currently present in the export log.
public EditorExportPlatform.ExportMessageType GetWorstMessageType()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SavePack(EditorExportPreset, bool, string, bool)
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).
public Dictionary SavePack(EditorExportPreset preset, bool debug, string path, bool embed = false)
Parameters
preset
EditorExportPresetdebug
boolpath
stringembed
bool
Returns
SavePackPatch(EditorExportPreset, bool, 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
).
public Dictionary SavePackPatch(EditorExportPreset preset, bool debug, string path)
Parameters
preset
EditorExportPresetdebug
boolpath
string
Returns
SaveZip(EditorExportPreset, bool, 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
).
public Dictionary SaveZip(EditorExportPreset preset, bool debug, string path)
Parameters
preset
EditorExportPresetdebug
boolpath
string
Returns
SaveZipPatch(EditorExportPreset, bool, 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
).
public Dictionary SaveZipPatch(EditorExportPreset preset, bool debug, string path)
Parameters
preset
EditorExportPresetdebug
boolpath
string
Returns
SshPushToRemote(string, string, ReadOnlySpan<string>, string, string)
Uploads specified file over SCP protocol to the remote host.
public Error SshPushToRemote(string host, string port, ReadOnlySpan<string> scpArgs, string srcFile, string dstFile)
Parameters
Returns
SshPushToRemote(string, string, string[], string, string)
Uploads specified file over SCP protocol to the remote host.
public Error SshPushToRemote(string host, string port, string[] scpArgs, string srcFile, string dstFile)
Parameters
Returns
SshRunOnRemote(string, string, ReadOnlySpan<string>, string, Array, int)
Executes specified command on the remote host via SSH protocol and returns command output in the output
.
public Error SshRunOnRemote(string host, string port, ReadOnlySpan<string> sshArg, string cmdArgs, Array output, int portFwd)
Parameters
Returns
SshRunOnRemote(string, string, string[], string, Array, int)
Executes specified command on the remote host via SSH protocol and returns command output in the output
.
public Error SshRunOnRemote(string host, string port, string[] sshArg, string cmdArgs, Array output = null, int portFwd = -1)
Parameters
Returns
SshRunOnRemoteNoWait(string, string, ReadOnlySpan<string>, string, int)
Executes specified command on the remote host via SSH protocol and returns process ID (on the remote host) without waiting for command to finish.
public long SshRunOnRemoteNoWait(string host, string port, ReadOnlySpan<string> sshArgs, string cmdArgs, int portFwd)
Parameters
Returns
SshRunOnRemoteNoWait(string, string, string[], string, int)
Executes specified command on the remote host via SSH protocol and returns process ID (on the remote host) without waiting for command to finish.
public long SshRunOnRemoteNoWait(string host, string port, string[] sshArgs, string cmdArgs, int portFwd = -1)