Skip to content

Commit ec0b7ad

Browse files
Merge branch 'main' into armcknight/ci/fix-release
2 parents a89577a + d637379 commit ec0b7ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+632
-314
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ jobs:
8787
name: raw-build-output-scheme-${{matrix.scheme}}
8888
path: |
8989
raw-build-output.log
90+
build-spm:
91+
name: Build with SPM
92+
runs-on: macos-15
93+
steps:
94+
- uses: actions/checkout@v4
95+
# Only watchOS is compiling with SPM so far, the rest of the targets need profiling support which is still a work in progress due to the ObjC++ usage
96+
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace && EXPERIMENTAL_SPM_BUILDS=1 xcodebuild build -scheme SentrySPM -sdk watchos -destination 'generic/platform=watchOS'
97+
shell: sh
9098

9199
check-debug-without-UIKit:
92100
name: Check no UIKit linkage (DebugWithoutUIKit)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ GEM
173173
xcodeproj (>= 1.13.0, < 2.0.0)
174174
xcpretty (~> 0.4.1)
175175
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
176-
fastlane-plugin-sentry (1.28.1)
176+
fastlane-plugin-sentry (1.30.0)
177177
os (~> 1.1, >= 1.1.4)
178178
fastlane-sirp (1.0.0)
179179
sysrandom (~> 1.0)

Package.swift

Lines changed: 82 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,90 @@
11
// swift-tools-version:5.3
2+
import Darwin.C
23
import PackageDescription
34

5+
var products: [Product] = [
6+
.library(name: "Sentry", targets: ["Sentry"]),
7+
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
8+
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI"])
9+
]
10+
11+
var targets: [Target] = [
12+
.binaryTarget(
13+
name: "Sentry",
14+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry.xcframework.zip",
15+
checksum: "48a6c6693148a3f9096108164eb938a931b964395fcf38e169383b9e4cffcfc5" //Sentry-Static
16+
),
17+
.binaryTarget(
18+
name: "Sentry-Dynamic",
19+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry-Dynamic.xcframework.zip",
20+
checksum: "b9d9054c65ee5ac0591c27826edddc54490a96c2a83dee25519cae0c1a593231" //Sentry-Dynamic
21+
),
22+
.target (
23+
name: "SentrySwiftUI",
24+
dependencies: ["Sentry", "SentryInternal"],
25+
path: "Sources/SentrySwiftUI",
26+
exclude: ["SentryInternal/", "module.modulemap"],
27+
linkerSettings: [
28+
.linkedFramework("Sentry")
29+
]),
30+
.target(
31+
name: "SentryInternal",
32+
path: "Sources/SentrySwiftUI",
33+
sources: [
34+
"SentryInternal/"
35+
],
36+
publicHeadersPath: "SentryInternal/")
37+
]
38+
39+
let env = getenv("EXPERIMENTAL_SPM_BUILDS")
40+
if let env, String(cString: env, encoding: .utf8) == "1" {
41+
products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"]))
42+
targets.append(contentsOf: [
43+
// At least one source file is required
44+
.target(name: "SentryHeaders", path: "Sources/Sentry", sources: ["SentryDsn.m"], publicHeadersPath: "Public"),
45+
.target(
46+
name: "_SentryPrivate",
47+
dependencies: ["SentryHeaders"],
48+
path: "Sources/Sentry",
49+
sources: ["NSLocale+Sentry.m"],
50+
publicHeadersPath: "include",
51+
cSettings: [.headerSearchPath("include/HybridPublic")]),
52+
.target(
53+
name: "SentrySwift",
54+
dependencies: ["_SentryPrivate", "SentryHeaders"],
55+
path: "Sources/Swift",
56+
swiftSettings: [
57+
// The application extension flag is required due to https://github.com/getsentry/sentry-cocoa/issues/5371
58+
.unsafeFlags(["-enable-library-evolution", "-Xfrontend", "-application-extension"]),
59+
// This flag is used to make some API breaking changes necessary for the framework to compile with SPM.
60+
// We can either make more extensive changes to allow it to be backwards compatible, or release them as part of a V9 release.
61+
// For now we use this flag so that CI can compile the SPM version.
62+
.define("SENTRY_SWIFT_PACKAGE")
63+
],
64+
linkerSettings: [
65+
.unsafeFlags(["-Xlinker", "-application_extension"])
66+
]),
67+
.target(
68+
name: "SentryObjc",
69+
dependencies: ["SentrySwift"],
70+
path: "Sources",
71+
exclude: ["Sentry/SentryDsn.m", "Sentry/NSLocale+Sentry.m", "Swift", "SentrySwiftUI", "Resources", "Configuration"],
72+
cSettings: [
73+
.headerSearchPath("Sentry/include/HybridPublic"),
74+
.headerSearchPath("Sentry"),
75+
.headerSearchPath("SentryCrash/Recording"),
76+
.headerSearchPath("SentryCrash/Recording/Monitors"),
77+
.headerSearchPath("SentryCrash/Recording/Tools"),
78+
.headerSearchPath("SentryCrash/Installations"),
79+
.headerSearchPath("SentryCrash/Reporting/Filters"),
80+
.headerSearchPath("SentryCrash/Reporting/Filters/Tools")])
81+
])
82+
}
83+
484
let package = Package(
585
name: "Sentry",
686
platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4)],
7-
products: [
8-
.library(name: "Sentry", targets: ["Sentry"]),
9-
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
10-
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI"])
11-
],
12-
targets: [
13-
.binaryTarget(
14-
name: "Sentry",
15-
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry.xcframework.zip",
16-
checksum: "48a6c6693148a3f9096108164eb938a931b964395fcf38e169383b9e4cffcfc5" //Sentry-Static
17-
),
18-
.binaryTarget(
19-
name: "Sentry-Dynamic",
20-
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry-Dynamic.xcframework.zip",
21-
checksum: "b9d9054c65ee5ac0591c27826edddc54490a96c2a83dee25519cae0c1a593231" //Sentry-Dynamic
22-
),
23-
.target ( name: "SentrySwiftUI",
24-
dependencies: ["Sentry", "SentryInternal"],
25-
path: "Sources/SentrySwiftUI",
26-
exclude: ["SentryInternal/", "module.modulemap"],
27-
linkerSettings: [
28-
.linkedFramework("Sentry")
29-
]
30-
),
31-
.target( name: "SentryInternal",
32-
path: "Sources/SentrySwiftUI",
33-
sources: [
34-
"SentryInternal/"
35-
],
36-
publicHeadersPath: "SentryInternal/"
37-
),
38-
.target(name: "SentryCoreSwift", path: "Sources/Swift/Core")
39-
],
87+
products: products,
88+
targets: targets,
4089
cxxLanguageStandard: .cxx14
4190
)

0 commit comments

Comments
 (0)