EditorExportPlugin
A script that is executed when exporting the project.
EditorExportPlugin.swift:14class EditorExportPlugin
EditorExportPlugin
s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, _exportBegin(features:isDebug:path:flags:)
is called at the beginning of the export process and then _exportFile(path:type:features:)
is called for each exported file.
To use EditorExportPlugin
, register it using the addExportPlugin(_:)
method first.
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func addFile(path: String, file: PackedByteArray, remap: Bool
) Adds a custom file to be exported.
path
is the virtual path that can be used to load the file,file
is the binary data of the file.func addIosBundleFile(path: String
) Adds an iOS bundle file from the given
path
to the exported project.func addIosCppCode(String
) Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin.
func addIosEmbeddedFramework(path: String
) Adds a dynamic library (*.dylib, *.framework) to Linking Phase in iOS’s Xcode project and embeds it into resulting binary.
func addIosFramework(path: String
) Adds a static library (.a) or dynamic library (.dylib, *.framework) to Linking Phase in iOS’s Xcode project.
func addIosLinkerFlags(String
) Adds linker flags for the iOS export.
func addIosPlistContent(String
) Adds content for iOS Property List files.
func addIosProjectStaticLib(path: String
) Adds a static lib from the given
path
to the iOS project.func addMacosPluginFile(path: String
) Adds file or directory matching
path
toPlugIns
directory of macOS app bundle.func getOption(name: StringName
) -> Variant Returns the current value of an export option supplied by
_getExportOptions(platform:)
.func skip(
) To be called inside
_exportFile(path:type:features:)
. Skips the current file, so it’s not included in the export.
Show implementation details (22)
Hide implementation details
func _beginCustomizeResources(platform: EditorExportPlatform?, features: PackedStringArray
) -> Bool Return
true
if this plugin will customize resources based on the platform and features used.func _beginCustomizeScenes(platform: EditorExportPlatform?, features: PackedStringArray
) -> Bool Return true if this plugin will customize scenes based on the platform and features used.
func _customizeResource(Resource?, path: String
) -> Resource? Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return
null
.func _customizeScene(Node?, path: String
) -> Node? Customize a scene. If changes are made to it, return the same or a new scene. Otherwise, return
null
. If a new scene is returned, it is up to you to dispose of the old one.func _endCustomizeResources(
) This is called when the customization process for resources ends.
func _endCustomizeScenes(
) This is called when the customization process for scenes ends.
func _exportBegin(features: PackedStringArray, isDebug: Bool, path: String, flags: UInt32
) Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export.
features
is the list of features for the export,isDebug
istrue
for debug builds,path
is the target path for the exported project.flags
is only used when running a runnable profile, e.g. when using native run on Android.func _exportEnd(
) Virtual method to be overridden by the user. Called when the export is finished.
func _exportFile(path: String, type: String, features: PackedStringArray
) Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file.
path
is the path of the file,type
is theResource
represented by the file (e.g.PackedScene
) andfeatures
is the list of features for the export.func _getAndroidDependencies(platform: EditorExportPlatform?, debug: Bool
) -> PackedStringArray Virtual method to be overridden by the user. This is called to retrieve the set of Android dependencies provided by this plugin. Each returned Android dependency should have the format of an Android remote binary dependency:
org.godot.example:my-plugin:0.0.0
func _getAndroidDependenciesMavenRepos(platform: EditorExportPlatform?, debug: Bool
) -> PackedStringArray Virtual method to be overridden by the user. This is called to retrieve the URLs of Maven repositories for the set of Android dependencies provided by this plugin.
func _getAndroidLibraries(platform: EditorExportPlatform?, debug: Bool
) -> PackedStringArray Virtual method to be overridden by the user. This is called to retrieve the local paths of the Android libraries archive (AAR) files provided by this plugin.
func _getAndroidManifestActivityElementContents(platform: EditorExportPlatform?, debug: Bool
) -> String Virtual method to be overridden by the user. This is used at export time to update the contents of the
activity
element in the generated Android manifest.func _getAndroidManifestApplicationElementContents(platform: EditorExportPlatform?, debug: Bool
) -> String Virtual method to be overridden by the user. This is used at export time to update the contents of the
application
element in the generated Android manifest.func _getAndroidManifestElementContents(platform: EditorExportPlatform?, debug: Bool
) -> String Virtual method to be overridden by the user. This is used at export time to update the contents of the
manifest
element in the generated Android manifest.func _getCustomizationConfigurationHash(
) -> UInt Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations.
func _getExportFeatures(platform: EditorExportPlatform?, debug: Bool
) -> PackedStringArray Return a
PackedStringArray
of additional features this preset, for the givenplatform
, should have.func _getExportOptionWarning(platform: EditorExportPlatform?, option: String
) -> String Check the requirements for the given
option
and return a non-empty warning string if they are not met.func _getExportOptions(platform: EditorExportPlatform?
) -> VariantCollection<GDictionary> Return a list of export options that can be configured for this export plugin.
func _getName(
) -> String Return the name identifier of this plugin (for future identification by the exporter). The plugins are sorted by name before exporting.
func _shouldUpdateExportOptions(platform: EditorExportPlatform?
) -> Bool Return
true
, if the result of_getExportOptions(platform:)
has changed and the export options of preset corresponding toplatform
should be updated.func _supportsPlatform(EditorExportPlatform?
) -> Bool Return
true
if the plugin supports the givenplatform
.