Skip to content

feat: add SPM traits for 3rd-party integrations - #8795

Merged
itaybre merged 4 commits into
mainfrom
feat/3rd-party-spm-traits
Aug 12, 2026
Merged

feat: add SPM traits for 3rd-party integrations#8795
itaybre merged 4 commits into
mainfrom
feat/3rd-party-spm-traits

Conversation

@itaybre

@itaybre itaybre commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add SentryFromBinary (default) and SentryFromSource mutually exclusive package traits to all 4 3rd-party integrations (SentryCocoaLumberjack, SentryPulse, SentrySwiftLog, SentrySwiftyBeaver)
  • Users can now select between precompiled Sentry xcframeworks (SentryFromBinary, the default) and building from source (SentryFromSource) via swift test --traits SentryFromSource or by enabling the trait in their dependency declaration
  • CI test matrix expanded to test both traits

Changes per integration

  • Package.swift: bumped to swift-tools-version:6.1, added traits, conditional product dependencies (Sentry vs SentrySPM), and swiftSettings with trait-based defines
  • Sources/*.swift: conditional import SentrySwift (from-source) vs import Sentry (binary)
  • Tests/*.swift: same conditional import
  • Sources/SentryTraitValidation.swift: #error if both traits enabled simultaneously

CI

  • Added trait matrix dimension (SentryFromBinary, SentryFromSource) to existing test-integrations-spm job
  • Precompiled-only steps (download xcframeworks, prepare-package.sh) are conditional on matrix.trait == 'SentryFromBinary'

Test plan

  • All 4 integrations pass swift test (default SentryFromBinary trait)
  • All 4 integrations pass swift test --traits SentryFromSource
  • CI passes with the new matrix

Add PrecompiledSentry (default) and SentryFromSource package
traits to all 3rd-party integrations so users can select
between precompiled xcframeworks and building from source.

- Bump swift-tools-version to 6.1 for trait support
- Add conditional product dependencies based on active trait
- Add conditional imports (Sentry vs SentrySwift)
- Add compile-time error if both traits are enabled
- Add SentryFromSource trait to CI test matrix
@itaybre itaybre added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Aug 12, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against f6ad53a

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f16dfe8. Configure here.

Comment thread .github/workflows/test-3rd-party-integrations.yml

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we need a changelog entry

Comment thread 3rd-party-integrations/SentryCocoaLumberjack/Package.swift
@itaybre
itaybre merged commit 486083b into main Aug 12, 2026
168 checks passed
@itaybre
itaybre deleted the feat/3rd-party-spm-traits branch August 12, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants