Skip to content

Add Swift Package Manager dependency support to EditorExportPlugin #15079

Description

@cengiz-pz

Problem or limitation

This PR, targeted for Godot 4.8, adds support for declaring Swift Package Manager (SPM) dependencies in an iOS plugin's .gdip file through the dependencies section:

[dependencies]
linked=[]
embedded=["res://Some.framework"]
system=["Another.framework"]
linker_flags=["-ObjC"]
spm_packages=[
  {
    "url": "https://github.com/googleads/swift-package-manager-google-mobile-ads.git",
    "version": "12.14.0",
    "products": ["GoogleMobileAds"]
  }
]

This enables iOS plugins to automatically add Swift Package Manager packages to the generated Xcode project.

However, equivalent functionality is not currently available through EditorExportPlugin. As a result, export plugins that generate or configure iOS dependencies dynamically cannot add SPM packages during the export process.

EditorExportPlugin already exposes methods for all other Apple platform dependency types:

void add_apple_embedded_platform_bundle_file(path: String)

void add_apple_embedded_platform_cpp_code(code: String)

void add_apple_embedded_platform_embedded_framework(path: String)

void add_apple_embedded_platform_framework(path: String)

void add_apple_embedded_platform_linker_flags(flags: String)

void add_apple_embedded_platform_plist_content(plist_content: String)

void add_apple_embedded_platform_project_static_lib(path: String)

Proposed improvement

Adding support for SPM packages would make the API feature-complete with respect to the dependency types supported by .gdip files and would allow export plugins to configure Swift Package Manager dependencies programmatically.

Proposed API

New EditorExportPlugin method:

void add_apple_embedded_platform_spm_package(
    url: String,
    version: String,
    products: PackedStringArray
)

This method would add a Swift Package Manager dependency to the generated Xcode project, matching the functionality currently available through the .gdip spm_packages dependency definition.

Proposal review

  • Yes, this proposal is highly specific and actionable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions