Skip to content

[Package] Hybrid+iOS app generation has no override path for the SalesforceMobileSDK-iOS SDK dependency (--sdkdependencies is a no-op for hybrid Podfile) - #346

Merged
JohnsonEricAtSalesforce merged 2 commits into
forcedotcom:devfrom
JohnsonEricAtSalesforce:bugfix/package-hybrid-ios-sdkdependencies-podfile-no-op
Aug 25, 2026
Merged

JohnsonEricAtSalesforce merged 2 commits into
forcedotcom:devfrom
JohnsonEricAtSalesforce:bugfix/package-hybrid-ios-sdkdependencies-podfile-no-op

Conversation

@JohnsonEricAtSalesforce

Copy link
Copy Markdown
Contributor

Summary

--sdkdependencies had no effect for hybrid+iOS app generation. The Podfile produced by the
Cordova plugin (SalesforceHybridSDK, MobileSync, SalesforceAnalytics, SalesforceSDKCommon,
SalesforceSDKCore, SmartStore) stays hardcoded to :branch => 'dev' against
SalesforceMobileSDK-iOS, regardless of the override. The existing overrideSdkDependencies()
only patches package.json's sdkDependencies block, which the hybrid+iOS Podfile-based pod
install never reads.

Fix: a new overrideHybridIosPodfile() rewrites the Podfile's pod lines to point at the
overridden git URL/branch. It runs right after cordova plugin add (which already ran pod install once against the plugin's hardcoded pod sources) and before cordova prepare, which
unconditionally reparses and rewrites the Podfile and reruns pod install a second time (the
plugin sets a deployment-target preference) — that second install is what actually picks up the
edit.

Test plan

  • Added unit tests for overrideHybridIosPodfile (full rewrite of affected pods,
    default-to-dev-branch when the override omits a branch, non-matching repo left untouched,
    missing-Podfile error path) — full suite passing (38/38)
  • Manually verified end-to-end by generating a hybrid iOS app with --sdkdependencies
    pointed at a real compatible SDK fork/branch — confirmed the Podfile override is applied and
    survives cordova prepare's pod install re-run

This response was generated by an AI agent on behalf of @JohnsonEricAtSalesforce.

The iOS SDK dependency for hybrid apps comes from a Podfile generated by
the Cordova plugin, hardcoded to the dev branch. overrideSdkDependencies()
only ever patched package.json, which that Podfile has no influence from,
so --sdkdependencies was a silent no-op for hybrid+iOS. Rewrite the
:git/:branch of any pod sourced from a repo named in the override, right
after `cordova plugin add` creates the Podfile and before `cordova
prepare` reparses/reinstalls it.
Comment thread shared/createHelper.js Outdated
…n instead of silently skipping when a matching pod isn't pinned with :branch)
@JohnsonEricAtSalesforce
JohnsonEricAtSalesforce merged commit 752436e into forcedotcom:dev Aug 25, 2026
13 of 17 checks passed
@JohnsonEricAtSalesforce
JohnsonEricAtSalesforce deleted the bugfix/package-hybrid-ios-sdkdependencies-podfile-no-op branch August 25, 2026 00:37
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.

2 participants