Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/test-3rd-party-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:

# SPM tests for all 3rd-party integrations
test-integrations-spm:
name: SPM Tests | ${{matrix.integration_dir}}
name: SPM Tests (${{matrix.trait}}) | ${{matrix.integration_dir}}
needs: [files-changed, build-xcframeworks]
if: startsWith(github.ref, 'refs/heads/release/') == false && (github.event_name != 'pull_request' || needs.files-changed.outputs.run_3rd_party_integrations_tests_for_prs == 'true')
runs-on: ["bitrise_pool_name:sequoia"]
Expand All @@ -92,6 +92,7 @@ jobs:
"SentryCocoaLumberjack",
"SentryPulse",
]
trait: ["SentryFromBinary", "SentryFromSource"]
steps:
- name: Warm CoreSimulator
run: xcrun simctl list runtimes -j > /dev/null 2>&1 &
Expand All @@ -115,12 +116,12 @@ jobs:
sed -i '' 's|\.package(url: "https://github\.com/getsentry/sentry-cocoa", from: "[^"]*")|.package(name: "sentry-cocoa", path: "../..")|g' Package.swift
- name: Run SPM Tests
working-directory: 3rd-party-integrations/${{matrix.integration_dir}}
run: swift test
Comment thread
itaybre marked this conversation as resolved.
run: swift test --traits ${{ matrix.trait }}
- name: Archiving Raw Logs
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: ${{ failure() || cancelled() }}
with:
name: raw-output-${{matrix.integration_dir}}-integration
name: raw-output-${{matrix.integration_dir}}-${{matrix.trait}}-integration
path: |
3rd-party-integrations/${{matrix.integration_dir}}/.build/**/*.log
- name: Run CI Diagnostics
Expand Down
21 changes: 18 additions & 3 deletions 3rd-party-integrations/SentryCocoaLumberjack/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:6.0
// swift-tools-version:6.1
Comment thread
itaybre marked this conversation as resolved.
import PackageDescription

let package = Package(
Expand All @@ -10,6 +10,11 @@ let package = Package(
targets: ["SentryCocoaLumberjack"]
)
],
traits: [
.default(enabledTraits: ["SentryFromBinary"]),
.init(name: "SentryFromBinary", description: "Use precompiled Sentry binary xcframeworks."),
.init(name: "SentryFromSource", description: "Build Sentry from source instead of using precompiled binaries.")
],
dependencies: [
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack", from: "3.8.0"),
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "9.25.0")
Expand All @@ -19,15 +24,25 @@ let package = Package(
name: "SentryCocoaLumberjack",
dependencies: [
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
.product(name: "Sentry", package: "sentry-cocoa")
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
),
.testTarget(
name: "SentryCocoaLumberjackTests",
dependencies: [
"SentryCocoaLumberjack",
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
.product(name: "Sentry", package: "sentry-cocoa")
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import CocoaLumberjackSwift
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif

Comment thread
itaybre marked this conversation as resolved.
/// A CocoaLumberjack logger that forwards log entries to Sentry's structured logging system.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if SENTRY_FROM_BINARY && SENTRY_FROM_SOURCE
#error("SentryFromBinary and SentryFromSource are mutually exclusive. Enable only one.")
#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@_spi(Private) @testable import SentryCocoaLumberjack
import CocoaLumberjackSwift
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif
import XCTest

// swiftlint:disable cyclomatic_complexity file_length type_body_length
Expand Down
23 changes: 19 additions & 4 deletions 3rd-party-integrations/SentryPulse/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:6.0
// swift-tools-version:6.1
import PackageDescription

let package = Package(
Expand All @@ -10,6 +10,11 @@ let package = Package(
targets: ["SentryPulse"]
)
],
traits: [
.default(enabledTraits: ["SentryFromBinary"]),
.init(name: "SentryFromBinary", description: "Use precompiled Sentry binary xcframeworks."),
.init(name: "SentryFromSource", description: "Build Sentry from source instead of using precompiled binaries.")
],
dependencies: [
.package(url: "https://github.com/kean/Pulse", from: "5.0.0"),
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "9.25.0")
Expand All @@ -19,16 +24,26 @@ let package = Package(
name: "SentryPulse",
dependencies: [
.product(name: "Pulse", package: "Pulse"),
.product(name: "Sentry", package: "sentry-cocoa")
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
),
.testTarget(
name: "SentryPulseTests",
dependencies: [
"SentryPulse",
.product(name: "Pulse", package: "Pulse"),
.product(name: "Sentry", package: "sentry-cocoa")
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
)
)
]
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import Combine
import Pulse
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif

/// Automatically forwards Pulse log messages to Sentry's structured logging system.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if SENTRY_FROM_BINARY && SENTRY_FROM_SOURCE
#error("SentryFromBinary and SentryFromSource are mutually exclusive. Enable only one.")
#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@testable import SentryPulse
import Pulse
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif
import XCTest

// swiftlint:disable cyclomatic_complexity
Expand Down
21 changes: 18 additions & 3 deletions 3rd-party-integrations/SentrySwiftLog/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:6.0
// swift-tools-version:6.1
import PackageDescription

let package = Package(
Expand All @@ -10,6 +10,11 @@ let package = Package(
targets: ["SentrySwiftLog"]
)
],
traits: [
.default(enabledTraits: ["SentryFromBinary"]),
.init(name: "SentryFromBinary", description: "Use precompiled Sentry binary xcframeworks."),
.init(name: "SentryFromSource", description: "Build Sentry from source instead of using precompiled binaries.")
],
dependencies: [
.package(url: "https://github.com/apple/swift-log", from: "1.5.0"),
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "9.25.0")
Expand All @@ -19,15 +24,25 @@ let package = Package(
name: "SentrySwiftLog",
dependencies: [
.product(name: "Logging", package: "swift-log"),
.product(name: "Sentry", package: "sentry-cocoa")
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
),
.testTarget(
name: "SentrySwiftLogTests",
dependencies: [
"SentrySwiftLog",
.product(name: "Logging", package: "swift-log"),
.product(name: "Sentry", package: "sentry-cocoa")
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"]))
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Logging
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif

/// A `swift-log` handler that forwards log entries to Sentry's structured logging system.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if SENTRY_FROM_BINARY && SENTRY_FROM_SOURCE
#error("SentryFromBinary and SentryFromSource are mutually exclusive. Enable only one.")
#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@testable import SentrySwiftLog
import Logging
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif
import XCTest

final class SentryLogHandlerTests: XCTestCase {
Expand Down
21 changes: 18 additions & 3 deletions 3rd-party-integrations/SentrySwiftyBeaver/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:6.0
// swift-tools-version:6.1
import PackageDescription

let package = Package(
Expand All @@ -10,6 +10,11 @@ let package = Package(
targets: ["SentrySwiftyBeaver"]
)
],
traits: [
.default(enabledTraits: ["SentryFromBinary"]),
.init(name: "SentryFromBinary", description: "Use precompiled Sentry binary xcframeworks."),
.init(name: "SentryFromSource", description: "Build Sentry from source instead of using precompiled binaries.")
],
dependencies: [
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "9.25.0"),
.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver.git", from: "2.0.0")
Expand All @@ -18,16 +23,26 @@ let package = Package(
.target(
name: "SentrySwiftyBeaver",
dependencies: [
.product(name: "Sentry", package: "sentry-cocoa"),
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"])),
.product(name: "SwiftyBeaver", package: "SwiftyBeaver")
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
),
.testTarget(
name: "SentrySwiftyBeaverTests",
dependencies: [
"SentrySwiftyBeaver",
.product(name: "Sentry", package: "sentry-cocoa"),
.product(name: "Sentry", package: "sentry-cocoa", condition: .when(traits: ["SentryFromBinary"])),
.product(name: "SentrySPM", package: "sentry-cocoa", condition: .when(traits: ["SentryFromSource"])),
.product(name: "SwiftyBeaver", package: "SwiftyBeaver")
],
swiftSettings: [
.define("SENTRY_FROM_BINARY", .when(traits: ["SentryFromBinary"])),
.define("SENTRY_FROM_SOURCE", .when(traits: ["SentryFromSource"]))
]
)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif
import SwiftyBeaver

/// A SwiftyBeaver destination that forwards log entries to Sentry's structured logging system.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if SENTRY_FROM_BINARY && SENTRY_FROM_SOURCE
#error("SentryFromBinary and SentryFromSource are mutually exclusive. Enable only one.")
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@testable import SentrySwiftyBeaver
#if SENTRY_FROM_SOURCE
import SentrySwift
#else
import Sentry
#endif
import SwiftyBeaver
import XCTest

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Unreleased

> [!WARNING]
> The 3rd-party integration packages (SentryCocoaLumberjack, SentryPulse, SentrySwiftLog, SentrySwiftyBeaver) now require Swift 6.1+ to support SPM package traits. Users on older Swift toolchains should pin to an earlier release of these packages.

### Features

- Promote `enableStandaloneAppStartTracing` from `options.experimental` to a top-level option on `Options` (#8715)
- Add `SentryFromBinary` (default) and `SentryFromSource` SPM package traits to 3rd-party integrations, allowing users to choose between precompiled xcframeworks and building from source. Requires Swift 6.1+ (#8795)
- Add experimental option `enableUIViewControllerInitSwizzling` that defers `UIViewController` swizzling to first instantiation instead of eagerly discovering and swizzling all subclasses at SDK start. This avoids realizing `@available`-gated `UIViewController` subclasses on OS versions below their gate, which crashes apps on start (#8687).
- Add screenshot picker to feedback (#8655)
- Enable it with `form.enableScreenshot = true` in the `configureForm` callback.
Expand Down
Loading