Skip to content

fix(ios): support Cordova plugins with Package.swift#8438

Merged
jcesarmobile merged 2 commits intomainfrom
RMET-5117
Apr 27, 2026
Merged

fix(ios): support Cordova plugins with Package.swift#8438
jcesarmobile merged 2 commits intomainfrom
RMET-5117

Conversation

@jcesarmobile
Copy link
Copy Markdown
Member

If the Cordova plugin already has a Package.swift, point to that file instead of generating a new one, but patching the repository url and version to point to the Capacitor one, also, in that case, don't copy the plugin files to capacitor-cordova-ios-plugins folder since it will be using the ones in node_modules

Also fixes an issue where the plugin files were copied to capacitor-cordova-ios-plugins/sourcesstatic/pluginName but the Package.swift was being generated, and pointed to capacitor-cordova-ios-plugins/sources/pluginName and failed to link the plugin since it had no files. The sourcesstatic folder is only needed for some CocoaPods plugins, not when using SPM.

Copy link
Copy Markdown
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still running more tests with different apps and combinations of plugins, but had noticed this here and just asking to see if it's relevant.

Comment thread cli/src/util/spm.ts
Copy link
Copy Markdown
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a few different apps with different plugins (Capacitor, Cordova with Package.swift, Cordova without Package.swift and without any dependencies), it's working good!

@jcesarmobile jcesarmobile merged commit 139943b into main Apr 27, 2026
6 checks passed
@jcesarmobile jcesarmobile deleted the RMET-5117 branch April 27, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants