class_editorexportplugin.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorExportPlugin.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorExportPlugin:
  6. EditorExportPlugin
  7. ==================
  8. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. A script that is executed when exporting the project.
  10. Description
  11. -----------
  12. ``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, :ref:`_export_begin<class_EditorExportPlugin_method__export_begin>` is called at the beginning of the export process and then :ref:`_export_file<class_EditorExportPlugin_method__export_file>` is called for each exported file.
  13. To use ``EditorExportPlugin``, register it using the :ref:`EditorPlugin.add_export_plugin<class_EditorPlugin_method_add_export_plugin>` method first.
  14. Methods
  15. -------
  16. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`_export_begin<class_EditorExportPlugin_method__export_begin>` **(** :ref:`PackedStringArray<class_PackedStringArray>` features, :ref:`bool<class_bool>` is_debug, :ref:`String<class_String>` path, :ref:`int<class_int>` flags **)** |virtual| |
  18. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`_export_end<class_EditorExportPlugin_method__export_end>` **(** **)** |virtual| |
  20. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`_export_file<class_EditorExportPlugin_method__export_file>` **(** :ref:`String<class_String>` path, :ref:`String<class_String>` type, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual| |
  22. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`add_file<class_EditorExportPlugin_method_add_file>` **(** :ref:`String<class_String>` path, :ref:`PackedByteArray<class_PackedByteArray>` file, :ref:`bool<class_bool>` remap **)** |
  24. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`add_ios_bundle_file<class_EditorExportPlugin_method_add_ios_bundle_file>` **(** :ref:`String<class_String>` path **)** |
  26. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`add_ios_cpp_code<class_EditorExportPlugin_method_add_ios_cpp_code>` **(** :ref:`String<class_String>` code **)** |
  28. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`add_ios_embedded_framework<class_EditorExportPlugin_method_add_ios_embedded_framework>` **(** :ref:`String<class_String>` path **)** |
  30. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_ios_framework<class_EditorExportPlugin_method_add_ios_framework>` **(** :ref:`String<class_String>` path **)** |
  32. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`add_ios_linker_flags<class_EditorExportPlugin_method_add_ios_linker_flags>` **(** :ref:`String<class_String>` flags **)** |
  34. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_ios_plist_content<class_EditorExportPlugin_method_add_ios_plist_content>` **(** :ref:`String<class_String>` plist_content **)** |
  36. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`add_ios_project_static_lib<class_EditorExportPlugin_method_add_ios_project_static_lib>` **(** :ref:`String<class_String>` path **)** |
  38. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`add_macos_plugin_file<class_EditorExportPlugin_method_add_macos_plugin_file>` **(** :ref:`String<class_String>` path **)** |
  40. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`add_shared_object<class_EditorExportPlugin_method_add_shared_object>` **(** :ref:`String<class_String>` path, :ref:`PackedStringArray<class_PackedStringArray>` tags, :ref:`String<class_String>` target **)** |
  42. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`skip<class_EditorExportPlugin_method_skip>` **(** **)** |
  44. +------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. Method Descriptions
  46. -------------------
  47. .. _class_EditorExportPlugin_method__export_begin:
  48. - void **_export_begin** **(** :ref:`PackedStringArray<class_PackedStringArray>` features, :ref:`bool<class_bool>` is_debug, :ref:`String<class_String>` path, :ref:`int<class_int>` flags **)** |virtual|
  49. 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, ``is_debug`` is ``true`` 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.
  50. ----
  51. .. _class_EditorExportPlugin_method__export_end:
  52. - void **_export_end** **(** **)** |virtual|
  53. Virtual method to be overridden by the user. Called when the export is finished.
  54. ----
  55. .. _class_EditorExportPlugin_method__export_file:
  56. - void **_export_file** **(** :ref:`String<class_String>` path, :ref:`String<class_String>` type, :ref:`PackedStringArray<class_PackedStringArray>` features **)** |virtual|
  57. 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 the :ref:`Resource<class_Resource>` represented by the file (e.g. :ref:`PackedScene<class_PackedScene>`) and ``features`` is the list of features for the export.
  58. Calling :ref:`skip<class_EditorExportPlugin_method_skip>` inside this callback will make the file not included in the export.
  59. ----
  60. .. _class_EditorExportPlugin_method_add_file:
  61. - void **add_file** **(** :ref:`String<class_String>` path, :ref:`PackedByteArray<class_PackedByteArray>` file, :ref:`bool<class_bool>` remap **)**
  62. 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. If ``remap`` is ``true``, file will not be exported, but instead remapped to the given ``path``.
  63. ----
  64. .. _class_EditorExportPlugin_method_add_ios_bundle_file:
  65. - void **add_ios_bundle_file** **(** :ref:`String<class_String>` path **)**
  66. Adds an iOS bundle file from the given ``path`` to the exported project.
  67. ----
  68. .. _class_EditorExportPlugin_method_add_ios_cpp_code:
  69. - void **add_ios_cpp_code** **(** :ref:`String<class_String>` code **)**
  70. Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin.
  71. ----
  72. .. _class_EditorExportPlugin_method_add_ios_embedded_framework:
  73. - void **add_ios_embedded_framework** **(** :ref:`String<class_String>` path **)**
  74. Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary.
  75. \ **Note:** For static libraries (\*.a) works in same way as ``add_ios_framework``.
  76. This method should not be used for System libraries as they are already present on the device.
  77. ----
  78. .. _class_EditorExportPlugin_method_add_ios_framework:
  79. - void **add_ios_framework** **(** :ref:`String<class_String>` path **)**
  80. Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project.
  81. ----
  82. .. _class_EditorExportPlugin_method_add_ios_linker_flags:
  83. - void **add_ios_linker_flags** **(** :ref:`String<class_String>` flags **)**
  84. Adds linker flags for the iOS export.
  85. ----
  86. .. _class_EditorExportPlugin_method_add_ios_plist_content:
  87. - void **add_ios_plist_content** **(** :ref:`String<class_String>` plist_content **)**
  88. Adds content for iOS Property List files.
  89. ----
  90. .. _class_EditorExportPlugin_method_add_ios_project_static_lib:
  91. - void **add_ios_project_static_lib** **(** :ref:`String<class_String>` path **)**
  92. Adds a static lib from the given ``path`` to the iOS project.
  93. ----
  94. .. _class_EditorExportPlugin_method_add_macos_plugin_file:
  95. - void **add_macos_plugin_file** **(** :ref:`String<class_String>` path **)**
  96. Adds file or directory matching ``path`` to ``PlugIns`` directory of macOS app bundle.
  97. \ **Note:** This is useful only for macOS exports.
  98. ----
  99. .. _class_EditorExportPlugin_method_add_shared_object:
  100. - void **add_shared_object** **(** :ref:`String<class_String>` path, :ref:`PackedStringArray<class_PackedStringArray>` tags, :ref:`String<class_String>` target **)**
  101. Adds a shared object or a directory containing only shared objects with the given ``tags`` and destination ``path``.
  102. \ **Note:** In case of macOS exports, those shared objects will be added to ``Frameworks`` directory of app bundle.
  103. In case of a directory code-sign will error if you place non code object in directory.
  104. ----
  105. .. _class_EditorExportPlugin_method_skip:
  106. - void **skip** **(** **)**
  107. To be called inside :ref:`_export_file<class_EditorExportPlugin_method__export_file>`. Skips the current file, so it's not included in the export.
  108. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  109. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  110. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  111. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  112. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  113. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`