diff options
Diffstat (limited to 'editor/editor_export.h')
| -rw-r--r-- | editor/editor_export.h | 65 |
1 files changed, 59 insertions, 6 deletions
diff --git a/editor/editor_export.h b/editor/editor_export.h index 50379b9683..346c3b58e1 100644 --- a/editor/editor_export.h +++ b/editor/editor_export.h @@ -118,13 +118,24 @@ public: EditorExportPreset(); }; +struct SharedObject { + String path; + Vector<String> tags; + + SharedObject(const String &p_path, const Vector<String> &p_tags) + : path(p_path), tags(p_tags) { + } + + SharedObject() {} +}; + class EditorExportPlatform : public Reference { GDCLASS(EditorExportPlatform, Reference) public: typedef Error (*EditorExportSaveFunction)(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total); - typedef Error (*EditorExportSaveSharedObject)(void *p_userdata, const String &p_path); + typedef Error (*EditorExportSaveSharedObject)(void *p_userdata, const SharedObject &p_so); private: struct SavedData { @@ -144,6 +155,7 @@ private: FileAccess *f; Vector<SavedData> file_ofs; EditorProgress *ep; + Vector<SharedObject> *so_files; }; struct ZipData { @@ -152,6 +164,11 @@ private: EditorProgress *ep; }; + struct FeatureContainers { + Set<String> features; + PoolVector<String> features_pv; + }; + void _export_find_resources(EditorFileSystemDirectory *p_dir, Set<String> &p_paths); void _export_find_dependencies(const String &p_path, Set<String> &p_paths); @@ -162,7 +179,16 @@ private: void _edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, Set<String> &r_list, bool exclude); void _edit_filter_list(Set<String> &r_list, const String &p_filter, bool exclude); + static Error _add_shared_object(void *p_userdata, const SharedObject &p_so); + protected: + struct ExportNotifier { + ExportNotifier(EditorExportPlatform &p_platform, const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags); + ~ExportNotifier(); + }; + + FeatureContainers get_feature_containers(const Ref<EditorExportPreset> &p_preset); + bool exists_export_template(String template_file_name, String *err) const; String find_export_template(String template_file_name, String *err = NULL) const; void gen_export_flags(Vector<String> &r_flags, int p_flags); @@ -192,7 +218,7 @@ public: Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func = NULL); - Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path); + Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path, Vector<SharedObject> *p_so_files = NULL); Error save_zip(const Ref<EditorExportPreset> &p_preset, const String &p_path); virtual bool poll_devices() { return false; } @@ -225,7 +251,7 @@ class EditorExportPlugin : public Reference { friend class EditorExportPlatform; - Vector<String> shared_objects; + Vector<SharedObject> shared_objects; struct ExtraFile { String path; Vector<uint8_t> data; @@ -234,26 +260,53 @@ class EditorExportPlugin : public Reference { Vector<ExtraFile> extra_files; bool skipped; + Vector<String> ios_frameworks; + String ios_plist_content; + String ios_linker_flags; + Vector<String> ios_bundle_files; + String ios_cpp_code; + _FORCE_INLINE_ void _clear() { shared_objects.clear(); extra_files.clear(); skipped = false; } + _FORCE_INLINE_ void _export_end() { + ios_frameworks.clear(); + ios_bundle_files.clear(); + ios_plist_content = ""; + ios_linker_flags = ""; + ios_cpp_code = ""; + } + void _export_file_script(const String &p_path, const String &p_type, const PoolVector<String> &p_features); - void _export_begin_script(const PoolVector<String> &p_features); + void _export_begin_script(const PoolVector<String> &p_features, bool p_debug, const String &p_path, int p_flags); protected: void add_file(const String &p_path, const Vector<uint8_t> &p_file, bool p_remap); - void add_shared_object(const String &p_path); + void add_shared_object(const String &p_path, const Vector<String> &tags); + + void add_ios_framework(const String &p_path); + void add_ios_plist_content(const String &p_plist_content); + void add_ios_linker_flags(const String &p_flags); + void add_ios_bundle_file(const String &p_path); + void add_ios_cpp_code(const String &p_code); + void skip(); virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features); - virtual void _export_begin(const Set<String> &p_features); + virtual void _export_begin(const Set<String> &p_features, bool p_debug, const String &p_path, int p_flags); static void _bind_methods(); public: + Vector<String> get_ios_frameworks() const; + String get_ios_plist_content() const; + String get_ios_linker_flags() const; + Vector<String> get_ios_bundle_files() const; + String get_ios_cpp_code() const; + EditorExportPlugin(); }; |
