Skip to content

fix(cli): handle Cordova plugins without iOS source files#8443

Open
OS-ruimoreiramendes wants to merge 5 commits intomainfrom
fix/RMET-5159/cdv-without-src-code
Open

fix(cli): handle Cordova plugins without iOS source files#8443
OS-ruimoreiramendes wants to merge 5 commits intomainfrom
fix/RMET-5159/cdv-without-src-code

Conversation

@OS-ruimoreiramendes
Copy link
Copy Markdown
Contributor

  • Fix getPluginPlatform to return undefined instead of [] when a plugin has no <platform> tags
  • Skip Package.swift generation for Cordova plugins with <platform name="ios"> but no source files
  • Skip adding those plugins to the generated CapApp-SPM/Package.swift

Reference: https://outsystemsrd.atlassian.net/browse/RMET-5159

Tests
Validated with three dummy plugins:
test-plugin-no-platform: no <platform> tags -> correctly skipped as incompatible
test-plugin-no-sources: <platform name="ios"> with only entries -> sync completes, config still processed
test-plugin-with-sources: <platform name="ios"> with source files -> continues to work normally

@jcesarmobile
Copy link
Copy Markdown
Member

if the plugin gets skipped as incompatible, then the copying of the plugin's .js files also gets skipped, that's why getPluginPlatform is returning [] instead of undefined, so even if there is no native files, the .js files still get copied.
So getPluginPlatform shouldn't be changed to return undefined.

@OS-ruimoreiramendes
Copy link
Copy Markdown
Contributor Author

if the plugin gets skipped as incompatible, then the copying of the plugin's .js files also gets skipped, that's why getPluginPlatform is returning [] instead of undefined, so even if there is no native files, the .js files still get copied. So getPluginPlatform shouldn't be changed to return undefined.

confirmed your point. With undefined, plugins without a <platform> tag were marked as Incompatible and their .js files were not copied. With [] it works correctly.
Reverted.

@alexgerardojacinto
Copy link
Copy Markdown

alexgerardojacinto commented Apr 29, 2026

Minor: I think the PR title should be fix(cli):...

@OS-ruimoreiramendes OS-ruimoreiramendes changed the title fix: handle Cordova plugins without iOS source files fix(cli): handle Cordova plugins without iOS source files Apr 30, 2026
Comment thread cli/src/util/spm.ts
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