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
#skip-changelog
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
PrecompiledSentry(default) andSentryFromSourcemutually exclusive package traits to all 4 3rd-party integrations (SentryCocoaLumberjack, SentryPulse, SentrySwiftLog, SentrySwiftyBeaver)PrecompiledSentry, the default) and building from source (SentryFromSource) viaswift test --traits SentryFromSourceor by enabling the trait in their dependency declarationChanges per integration
SentryvsSentrySPM), andswiftSettingswith trait-based definesimport SentrySwift(from-source) vsimport Sentry(precompiled)#errorif both traits enabled simultaneouslyCI
traitmatrix dimension (PrecompiledSentry,SentryFromSource) to existingtest-integrations-spmjobSentryFromSourceentriesTest plan
swift test(defaultPrecompiledSentrytrait)swift test --traits SentryFromSource#skip-changelog