refactor: unify CocoaPods distribution with single podspec#731
Closed
refactor: unify CocoaPods distribution with single podspec#731
Conversation
6bb1cba to
67bf3bb
Compare
📦 SDK Size Impact ReportMeasures how much the SDK adds to an app's size (with-SDK minus without-SDK).
➡️ SDK size impact change is minimal. Raw measurementsTarget branch (main): {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1880,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1796,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6532}This PR: {"baseline_app_size_kb":84,"baseline_executable_size_bytes":75464,"with_sdk_app_size_kb":1880,"with_sdk_executable_size_bytes":76312,"sdk_impact_kb":1796,"sdk_executable_impact_bytes":848,"xcframework_size_kb":6532} |
…ional kit imports Consolidate the SDK's CocoaPods distribution by folding the umbrella Swift sources (MParticle/Sources/) into the main mParticle-Apple-SDK.podspec and deleting the separate mParticle-Apple-SDK-Umbrella pod. The core podspec restores `module_name = mParticle_Apple_SDK` (matching v8.x), so end-user imports (`@import mParticle_Apple_SDK;` / `import mParticle_Apple_SDK`) are backward-compatible for both SPM and CocoaPods consumers. Kit ObjC headers now use `#if COCOAPODS` to resolve the module name difference between CocoaPods (`mParticle_Apple_SDK`) and SPM (`mParticle_Apple_SDK_ObjC`). The Swift exports file guards the ObjC re-export the same way, while always re-exporting RoktContracts. CI workflows are simplified to lint/publish a single core podspec.
67bf3bb to
e3b435d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MParticle/Sources/) into the mainmParticle-Apple-SDK.podspecand removing the separatemParticle-Apple-SDK-Umbrellapodmodule_name = mParticle_Apple_SDK(matching v8.x) so consumer imports (@import mParticle_Apple_SDK;/import mParticle_Apple_SDK) are backward-compatible#if COCOAPODSconditional in kit ObjC headers to resolve module name differences between CocoaPods (mParticle_Apple_SDK) and SPM (mParticle_Apple_SDK_ObjC)Motivation
The previous approach on
feat/support_cocopodssplit the SDK into 3 separate CocoaPods pods and changed the ObjC module name tomParticle_Apple_SDK_ObjC, breaking backward-compatible imports for consumers. This PR replaces that approach with a single-podspec structure that preserves the v8.x import patterns.Changes
module_namerestored tomParticle_Apple_SDK; umbrella Swift sources folded in;mParticle-Apple-SDK-Swiftkept as dependency (required by Xcode build system)mParticleAppleSDKExports.swiftuses#if !COCOAPODSguard for the ObjC module re-export#if COCOAPODS @import mParticle_Apple_SDK; #else @import mParticle_Apple_SDK_ObjC; #endifpath()dependency bug; usesUSE_LOCAL_VERSIONenv var for local devbuild-and-lint.yml,build-kits.yml,release-publish.ymlsimplified to single podspecTest plan
pod lib lint mParticle-Apple-SDK.podspecpassespod lib lint mParticle-Rokt.podspecpassespod install+ workspace build inExample/succeedsxcodebuild -scheme mParticle-Apple-SDK) succeedsmParticle-Rokt.xcodeproj) succeeds