Skip to content

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

Description

@github-actions

Note

The pull request "feat: add SPM traits for 3rd-party integrations" was created by @itaybre but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

Summary

  • Add PrecompiledSentry (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 (PrecompiledSentry, 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 (precompiled)
  • Tests/*.swift: same conditional import
  • Sources/SentryTraitValidation.swift: #error if both traits enabled simultaneously

CI

  • Added trait matrix dimension (PrecompiledSentry, SentryFromSource) to existing test-integrations-spm job
  • Precompiled-only steps (download xcframeworks, prepare-package.sh) are skipped for SentryFromSource entries

Test plan

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

#skip-changelog

Metadata

Metadata

Assignees

Labels

autocreatedThis issue was created automatically by one of the workflows

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions