Skip to content

chore: unify kit SPM dependency pattern and CI local SDK#709

Merged
thomson-t merged 7 commits intomainfrom
feat/kit-spm-local-version
Apr 7, 2026
Merged

chore: unify kit SPM dependency pattern and CI local SDK#709
thomson-t merged 7 commits intomainfrom
feat/kit-spm-local-version

Conversation

@denischilik
Copy link
Copy Markdown
Contributor

@denischilik denischilik commented Apr 7, 2026

Background

Kit Package.swift files use one pattern for the main SDK: local path when developing in the monorepo (USE_LOCAL_VERSION), or branch: main / .upToNextMajor(from:) when let version is set. CI and release kit builds set USE_LOCAL_VERSION so compilation matches the checkout being built.

What Has Changed

  • Standardized SPM mParticleAppleSDK blocks across kits (including Rokt), with package: "mparticle-apple-sdk" where needed.
  • build-kits.yml sets USE_LOCAL_VERSION for kit CI.
  • release-draft.yml updates let version in kit Package.swift files on major version bumps.
  • release-publish.yml sets USE_LOCAL_VERSION when building kit xcframeworks.

Screenshots/Video

N/A

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

- Use .package(path:) for monorepo builds; branch: is only for remote git refs.
- Point path at repo root (../../../ from Kits/adjust/adjust-5).
- Default remote branch name held in version (main); release tooling can update later.
- Align product package identity with mparticle-apple-sdk.
- Set USE_LOCAL_VERSION in build-kits CI so kit jobs resolve the checked-out SDK.

Made-with: Cursor
…rom version

Empty version uses branch main; non-empty version sets .upToNextMajor(from:)
so release scripts only need to fill the semver string.

Made-with: Cursor
- Add shared mParticleAppleSDK block (USE_LOCAL_VERSION, empty version → branch main, else upToNextMajor).
- Replace per-kit branch/path mParticle package entries with mParticleAppleSDK.
- Align .product package identity to mparticle-apple-sdk where needed.
- Rokt kit: drop FLAG-based path toggle in favor of USE_LOCAL_VERSION like other kits.

Made-with: Cursor
Replace legacy sed on mParticle .package(branch/upToNextMajor) with a single
line substitution for the shared mParticleAppleSDK pattern.

Made-with: Cursor
…orks

Resolve mParticle-Apple-SDK from the monorepo checkout so release archives
match the same SDK sources as the VERSION bump; mirrors still use remote
SPM for consumers (no USE_LOCAL_VERSION there).

Made-with: Cursor
@denischilik denischilik requested a review from a team as a code owner April 7, 2026 15:17
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 7, 2026

PR Summary

Medium Risk
Medium risk because it changes kit dependency resolution and CI/release build inputs; mistakes could cause kits to build against the wrong SDK revision or break SPM resolution across many kits.

Overview
Standardizes how kits depend on the core SDK via SPM. Kit Package.swift files now share a common mParticleAppleSDK dependency block that chooses a local path when USE_LOCAL_VERSION is set, otherwise uses branch: main or .upToNextMajor(from:) based on let version (and aligns product package names to mparticle-apple-sdk).

Updates CI/release workflows to use the local checkout SDK. build-kits.yml and release-publish.yml now set USE_LOCAL_VERSION=1 so kit builds/xcframeworks compile against the SDK in the same repo commit. release-draft.yml also updates major-bump automation to rewrite let version = "..." in kit Package.swift files.

Reviewed by Cursor Bugbot for commit d43870e. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 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}

@nickolas-dimitrakas
Copy link
Copy Markdown
Contributor

nickolas-dimitrakas commented Apr 7, 2026

Flagging that if someone later indents the let version line (e.g., a formatter or manual edit), the sed would silently skip that file with no error, which is a subtle failure mode. We could address by moving to the sed command below, but not a case we should be running into I think.

sed -i '' 's/^[[:space:]]*let version = "[^"]*"/let version = "'"${VERSION}"'"/' {} +

@thomson-t thomson-t merged commit f88be61 into main Apr 7, 2026
199 of 205 checks passed
@thomson-t thomson-t deleted the feat/kit-spm-local-version branch April 7, 2026 17:23
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