Skip to content

refactor: unify CocoaPods distribution with single podspec#731

Closed
thomson-t wants to merge 1 commit intomainfrom
feat/unify-cocoapods-podspec
Closed

refactor: unify CocoaPods distribution with single podspec#731
thomson-t wants to merge 1 commit intomainfrom
feat/unify-cocoapods-podspec

Conversation

@thomson-t
Copy link
Copy Markdown
Contributor

Summary

  • Consolidate the SDK's CocoaPods distribution by folding umbrella Swift sources (MParticle/Sources/) into the main mParticle-Apple-SDK.podspec and removing the separate mParticle-Apple-SDK-Umbrella pod
  • Restore module_name = mParticle_Apple_SDK (matching v8.x) so consumer imports (@import mParticle_Apple_SDK; / import mParticle_Apple_SDK) are backward-compatible
  • Use #if COCOAPODS conditional in kit ObjC headers to resolve module name differences between CocoaPods (mParticle_Apple_SDK) and SPM (mParticle_Apple_SDK_ObjC)
  • Simplify CI workflows to lint/publish a single core podspec

Motivation

The previous approach on feat/support_cocopods split the SDK into 3 separate CocoaPods pods and changed the ObjC module name to mParticle_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

Area What changed
Core podspec module_name restored to mParticle_Apple_SDK; umbrella Swift sources folded in; mParticle-Apple-SDK-Swift kept as dependency (required by Xcode build system)
Swift exports mParticleAppleSDKExports.swift uses #if !COCOAPODS guard for the ObjC module re-export
Kit headers All 34 kit ObjC files use #if COCOAPODS @import mParticle_Apple_SDK; #else @import mParticle_Apple_SDK_ObjC; #endif
Rokt kit podspec Fixed path() dependency bug; uses USE_LOCAL_VERSION env var for local dev
CI build-and-lint.yml, build-kits.yml, release-publish.yml simplified to single podspec
Example app Removed stale Media SDK import; simplified Podfile

Test plan

  • pod lib lint mParticle-Apple-SDK.podspec passes
  • pod lib lint mParticle-Rokt.podspec passes
  • pod install + workspace build in Example/ succeeds
  • SPM build of core SDK (xcodebuild -scheme mParticle-Apple-SDK) succeeds
  • SPM build of Rokt kit (mParticle-Rokt.xcodeproj) succeeds
  • Rokt kit SPM-Swift-Example builds
  • Rokt kit SPM-Objc-Example builds
  • CI pipeline passes (pending)

@thomson-t thomson-t force-pushed the feat/unify-cocoapods-podspec branch 3 times, most recently from 6bb1cba to 67bf3bb Compare April 9, 2026 03:43
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

📦 SDK Size Impact Report

Measures how much the SDK adds to an app's size (with-SDK minus without-SDK).

Metric Target Branch This PR Change
App Bundle Impact 1.75 MB 1.75 MB +N/A
Executable Impact 848 bytes 848 bytes +N/A
XCFramework Size 6.38 MB 6.38 MB +N/A

➡️ SDK size impact change is minimal.

Raw measurements

Target 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.
@thomson-t thomson-t force-pushed the feat/unify-cocoapods-podspec branch from 67bf3bb to e3b435d Compare April 9, 2026 04:20
@thomson-t thomson-t closed this Apr 10, 2026
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.

1 participant