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
28 changes: 28 additions & 0 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ run_unit_tests_for_prs: &run_unit_tests_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryV10Configuration/**"
- "Sources/SentryObjC/**"
Expand Down Expand Up @@ -83,6 +85,8 @@ run_distribution_tests_for_prs: &run_distribution_tests_for_prs
- "Sources/SentryDistribution/**"
- "Sources/SentryDistributionTests/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/Swift/**"
- "Sources/SentryV10Configuration/**"
- "Sources/SentryObjC/**"
Expand All @@ -91,6 +95,8 @@ run_distribution_tests_for_prs: &run_distribution_tests_for_prs
- "Tests/SentryObjCCompatTests/**"
- "Tests/SentryObjCTests/**"
- "Tests/SentryProfilerTests/**"
- "Tests/SentryNativeUtilsTests/**"
- "Tests/SentryProfilingTests/**"
- "Tests/SentryTests/**"
- "Tests/Fixtures/**"
- "Tests/SentryTestUtilsDynamic/**"
Expand Down Expand Up @@ -128,6 +134,8 @@ run_api_stability_for_prs: &run_api_stability_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -251,6 +259,8 @@ run_release_for_prs: &run_release_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryV10Configuration/**"
- "Sources/SentryObjC/**"
Expand Down Expand Up @@ -385,6 +395,8 @@ run_lint_xcode_analyze_for_prs: &run_lint_xcode_analyze_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -416,6 +428,8 @@ run_crash_e2e_for_prs:
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/Swift/**"
# Includes the app, Swift runner, and regression/live harness tests.
Expand Down Expand Up @@ -537,6 +551,8 @@ run_testflight_for_pushes: &run_testflight_for_pushes
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -564,6 +580,8 @@ run_codeql_analysis_for_prs: &run_codeql_analysis_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -634,6 +652,8 @@ run_ui_tests_for_prs: &run_ui_tests_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -680,6 +700,8 @@ run_ui_tests_critical_for_prs: &run_ui_tests_critical_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -721,6 +743,8 @@ run_lint_swiftlint_for_prs: &run_lint_swiftlint_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryDistribution/**"
- "Sources/SentryDistributionTests/**"
Expand Down Expand Up @@ -773,6 +797,8 @@ run_size_analysis_for_prs: &run_size_analysis_for_prs
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down Expand Up @@ -802,6 +828,8 @@ run_3rd_party_integrations_tests_for_prs: &run_3rd_party_integrations_tests_for_
- "Sources/include/**"
- "Sources/Resources/**"
- "Sources/Sentry/**"
- "Sources/SentryNativeUtils/**"
- "Sources/SentryProfiling/**"
- "Sources/SentryCppHelper/**"
- "Sources/SentryObjC/**"
- "Sources/SentryObjCCompat/**"
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,16 @@ test-testapp-tvOS-Swift-ui: xcode-ci-tvOS-Swift
-destination 'platform=tvOS Simulator,OS=$(TVOS_SIMULATOR_OS),name=$(TVOS_DEVICE_NAME)' \
CODE_SIGNING_ALLOWED="NO" 2>&1 | xcbeautify --preserve-unbeautified

## Run native utility package tests on all platforms
.PHONY: test-native-utils
test-native-utils:
@"$(MAKE)" test ONLY_TESTING=SentryNativeUtilsTests

## Run profiling package tests on all platforms
.PHONY: test-profiling
test-profiling:
@"$(MAKE)" test ONLY_TESTING=SentryProfilingTests

# ============================================================================
# LINTING & FORMATTING
# ============================================================================
Expand Down
46 changes: 40 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ if sourceUsesSentryModule {
} else {
products.append(.library(name: "SentrySPM", targets: ["SentryObjCInternal"]))
}
products += [
.library(name: "SentryNativeUtils", type: .static, targets: ["SentryNativeUtils"]),
.library(name: "SentryProfiling", type: .static, targets: ["SentryProfiling"])
]

let sentrySwiftTarget: Target = .target(
name: sentrySwiftTargetName,
dependencies: ["_SentryPrivate", "SentryHeaders"],
dependencies: ["_SentryPrivate", "SentryHeaders", "SentryNativeUtils", "SentryProfiling"],
path: "Sources/Swift",
cSettings: cSettings,
swiftSettings: swiftSettings
Expand All @@ -148,7 +153,9 @@ let sentryObjCInternalExcludes = [
"SentryObjCCompat",
"SentryTestUtils",
"SentryTestUtilsObjC",
"SentryTestUtilsObjCpp"
"SentryTestUtilsObjCpp",
"SentryNativeUtils",
"SentryProfiling"
]

let sentryObjCInternalCSettings: [CSetting] = [
Expand All @@ -160,6 +167,16 @@ let sentryPrivateDependencies: [Target.Dependency] = [
]

targets += [
// Shared Objective-C++ utilities only. No Swift sources or Swift target dependencies.
.target(
name: "SentryNativeUtils",
publicHeadersPath: "include"
),
.target(
name: "SentryProfiling",
dependencies: ["SentryNativeUtils"],
publicHeadersPath: "include"
),
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
.target(
name: "SentryHeaders",
Expand All @@ -176,7 +193,7 @@ targets += [
),
.target(
name: "_SentryPrivate",
dependencies: sentryPrivateDependencies,
dependencies: sentryPrivateDependencies + ["SentryNativeUtils", "SentryProfiling"],
path: "Sources/Sentry",
sources: ["SentryDummyPrivateEmptyClass.m"],
publicHeadersPath: "include",
Expand All @@ -187,7 +204,7 @@ targets += [
]

let sentryObjCInternalDependencies: [Target.Dependency] = [
.target(name: sentrySwiftTargetName), .product(name: "Recording", package: "KSCrash")
.target(name: sentrySwiftTargetName), "SentryNativeUtils", "SentryProfiling", .product(name: "Recording", package: "KSCrash")
]

targets += [
Expand Down Expand Up @@ -227,6 +244,23 @@ targets += [
]
// END:OBJC_WRAPPER

targets += [
.target(
name: "SentryNativeUtilsTestSupport",
path: "Tests/SentryNativeUtilsTests/Support",
publicHeadersPath: "include"
),
.testTarget(
name: "SentryNativeUtilsTests",
dependencies: ["SentryNativeUtils", "SentryNativeUtilsTestSupport"],
exclude: ["Support"]
),
.testTarget(
name: "SentryProfilingTests",
dependencies: ["SentryProfiling"]
)
]

targets += [
.target(
name: "SentryTestUtilsObjC",
Expand Down Expand Up @@ -293,7 +327,7 @@ targets += [
dependencies: [
.product(name: "Recording", package: "KSCrash"),
.product(name: "RecordingCore", package: "KSCrash"),
.target(name: sentrySwiftTargetName), "_SentryPrivate", "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp",
.target(name: sentrySwiftTargetName), "_SentryPrivate", "SentryNativeUtils", "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp",
.product(name: "SentryTestUtilsDynamic", package: "SentryTestUtilsDynamic", condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .visionOS]))
],
path: "Tests/SentryTests",
Expand Down Expand Up @@ -349,7 +383,7 @@ if !envSelectsV10 {
targets += [
.testTarget(
name: "SentryProfilerTests",
dependencies: [.target(name: sentrySwiftTargetName), "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp"],
dependencies: [.target(name: sentrySwiftTargetName), "SentryProfiling", "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp"],
path: "Tests/SentryProfilerTests",
exclude: ["ObjC"],
cSettings: cSettings,
Expand Down
46 changes: 40 additions & 6 deletions Package@swift-6.1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,16 @@ if sourceUsesSentryModule {
products.append(.library(name: "SentrySPM", targets: ["SentryObjCInternal"]))
}

products += [
.library(name: "SentryNativeUtils", type: .static, targets: ["SentryNativeUtils"]),
.library(name: "SentryProfiling", type: .static, targets: ["SentryProfiling"])
]

let sentrySwiftTarget: Target = .target(
name: sentrySwiftTargetName,
dependencies: [
"_SentryPrivate",
"SentryHeaders"
"SentryHeaders", "SentryNativeUtils", "SentryProfiling"
] + kscrashSwiftDependencies,
path: "Sources/Swift",
cSettings: cSettings,
Expand All @@ -155,7 +160,9 @@ let sentryObjCInternalExcludes = [
"SentryObjCCompat",
"SentryTestUtils",
"SentryTestUtilsObjC",
"SentryTestUtilsObjCpp"
"SentryTestUtilsObjCpp",
"SentryNativeUtils",
"SentryProfiling"
]

let sentryObjCInternalCSettings: [CSetting] = [
Expand All @@ -167,6 +174,16 @@ let sentryObjCInternalCSettings: [CSetting] = [
let sentryPrivateDependencies: [Target.Dependency] = ["SentryHeaders"] + kscrashDependencies

targets += [
// Shared Objective-C++ utilities only. No Swift sources or Swift target dependencies.
.target(
name: "SentryNativeUtils",
publicHeadersPath: "include"
),
.target(
name: "SentryProfiling",
dependencies: ["SentryNativeUtils"],
publicHeadersPath: "include"
),
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
.target(
name: "SentryHeaders",
Expand All @@ -183,7 +200,7 @@ targets += [
),
.target(
name: "_SentryPrivate",
dependencies: sentryPrivateDependencies,
dependencies: sentryPrivateDependencies + ["SentryNativeUtils", "SentryProfiling"],
path: "Sources/Sentry",
sources: ["SentryDummyPrivateEmptyClass.m"],
publicHeadersPath: "include",
Expand All @@ -193,7 +210,7 @@ targets += [
sentrySwiftTarget
]

let sentryObjCInternalDependencies: [Target.Dependency] = [.target(name: sentrySwiftTargetName)] + kscrashDependencies
let sentryObjCInternalDependencies: [Target.Dependency] = [.target(name: sentrySwiftTargetName), "SentryNativeUtils", "SentryProfiling"] + kscrashDependencies

targets += [
// The SDK's ObjC/C sources use KSCrash in every source-build configuration.
Expand Down Expand Up @@ -236,6 +253,23 @@ targets += [
// END:OBJC_WRAPPER

// Swift 6.1 needs smaller expressions to type-check the test targets.
targets += [
.target(
name: "SentryNativeUtilsTestSupport",
path: "Tests/SentryNativeUtilsTests/Support",
publicHeadersPath: "include"
),
.testTarget(
name: "SentryNativeUtilsTests",
dependencies: ["SentryNativeUtils", "SentryNativeUtilsTestSupport"],
exclude: ["Support"]
),
.testTarget(
name: "SentryProfilingTests",
dependencies: ["SentryProfiling"]
)
]

targets += [
.target(
name: "SentryTestUtilsObjC",
Expand Down Expand Up @@ -319,7 +353,7 @@ targets += [
dependencies: [
.product(name: "Recording", package: "KSCrash"),
.product(name: "RecordingCore", package: "KSCrash"),
.target(name: sentrySwiftTargetName), "_SentryPrivate", "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp",
.target(name: sentrySwiftTargetName), "_SentryPrivate", "SentryNativeUtils", "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp",
.product(name: "SentryTestUtilsDynamic", package: "SentryTestUtilsDynamic", condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .visionOS]))
],
path: "Tests/SentryTests",
Expand Down Expand Up @@ -387,7 +421,7 @@ if !envSelectsV10 {
targets += [
.testTarget(
name: "SentryProfilerTests",
dependencies: [.target(name: sentrySwiftTargetName), "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp"],
dependencies: [.target(name: sentrySwiftTargetName), "SentryProfiling", "SentryTestUtils", "SentryTestUtilsObjC", "SentryTestUtilsObjCpp"],
path: "Tests/SentryProfilerTests",
exclude: ["ObjC"],
// Keep Swift's Clang importer consistent with the NoUI SDK declarations.
Expand Down
Loading
Loading