Skip to content

Commit 0be2621

Browse files
authored
Merge d8327ae into 7416ffc
2 parents 7416ffc + d8327ae commit 0be2621

File tree

6 files changed

+143
-16
lines changed

6 files changed

+143
-16
lines changed

.github/workflows/api-stability.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- ".github/workflows/api-stability.yml"
99
- Sentry.xcworkspace/**
1010
- Sentry.xcodeproj/**
11-
- "Package.swift"
11+
- "Package*.swift"
1212
- "scripts/build-xcframework-local.sh"
1313
- "scripts/update-api.sh"
1414
- "scripts/ci-select-xcode.sh"

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- Sentry.xcworkspace/**
1717
- Sentry.xcodeproj/**
1818
- Gemfile.lock
19-
- "Package.swift"
19+
- "Package*.swift"
2020
- "Makefile" # Make commands used for CI build setup
2121
- "Brewfile*" # Dependency installation affects build environment
2222

.github/workflows/release.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- "scripts/ci-select-xcode.sh"
1313
- Sentry.xcworkspace/**
1414
- Sentry.xcodeproj/**
15-
- "Package.swift"
15+
- "Package*.swift"
1616
- ".github/workflows/build-xcframework.yml"
1717
- "scripts/build-xcframework-slice.sh"
1818
- "scripts/assemble-xcframework.sh"
@@ -122,7 +122,7 @@ jobs:
122122
# the github.sha is be the pre merge commit id for PRs.
123123
# See https://github.saobby.my.eu.orgmunity/t/github-sha-isnt-the-value-expected/17903/17906.
124124
validate-spm:
125-
name: Validate SPM Static
125+
name: Validate SPM Static ${{matrix.package-file.name}}
126126
runs-on: macos-14
127127
needs: assemble-xcframework-variant
128128
steps:
@@ -131,17 +131,25 @@ jobs:
131131
with:
132132
pattern: xcframework-${{github.sha}}-*
133133
merge-multiple: true
134+
- name: Remove newer package files
135+
if: ${{ matrix.package-file.name == 'Package.swift' }}
136+
run: rm -rf Package@swift*
134137
- name: Change path of the framework
135138
run: |
136-
sed -i '' 's/url.*//g' Package.swift
137-
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
138-
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
139+
sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
140+
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
141+
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
139142
shell: bash
140143
- run: swift build
141144
working-directory: Samples/macOS-SPM-CommandLine
145+
strategy:
146+
matrix:
147+
package-file:
148+
- name: Package.swift
149+
- name: Package@swift-5.9.swift
142150

143151
validate-spm-dynamic:
144-
name: Validate SPM Dynamic
152+
name: Validate SPM Dynamic ${{matrix.package-file.name}}
145153
runs-on: macos-14
146154
needs: assemble-xcframework-variant
147155
steps:
@@ -150,17 +158,25 @@ jobs:
150158
with:
151159
pattern: xcframework-${{github.sha}}-*
152160
merge-multiple: true
161+
- name: Remove newer package files
162+
if: ${{ matrix.package-file.name == 'Package.swift' }}
163+
run: rm -rf Package@swift*
153164
- name: Change path of the framework
154165
run: |
155-
sed -i '' 's/url.*//g' Package.swift
156-
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
157-
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
166+
sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
167+
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
168+
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
158169
shell: bash
159170
- run: swift build
160171
working-directory: Samples/SPM-Dynamic
172+
strategy:
173+
matrix:
174+
package-file:
175+
- name: Package.swift
176+
- name: Package@swift-5.9.swift
161177

162178
swift-build:
163-
name: Build Swift Static
179+
name: Build Swift Static ${{matrix.package-file.name}}
164180
runs-on: macos-14
165181
needs: assemble-xcframework-variant
166182
steps:
@@ -169,13 +185,21 @@ jobs:
169185
with:
170186
pattern: xcframework-${{github.sha}}-*
171187
merge-multiple: true
188+
- name: Remove newer package files
189+
if: ${{ matrix.package-file.name == 'Package.swift' }}
190+
run: rm -rf Package@swift*
172191
- name: Change path of the framework
173192
run: |
174-
sed -i '' 's/url.*//g' Package.swift
175-
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
176-
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
193+
sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
194+
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
195+
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
177196
shell: bash
178197
- run: swift build
198+
strategy:
199+
matrix:
200+
package-file:
201+
- name: Package.swift
202+
- name: Package@swift-5.9.swift
179203

180204
duplication-tests:
181205
name: Test Sentry Duplication V4 # Up the version with every change to keep track of flaky tests

.github/workflows/test-cross-platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- "Sources/**"
1111
- "Sentry.podspec"
1212
- "SentrySwiftUI.podspec"
13-
- "Package.swift"
13+
- "Package*.swift"
1414
- "Makefile" # Make commands used for cross-platform setup
1515
- "Brewfile*" # Dependency installation affects cross-platform testing
1616

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Fix Infinite Session Replay Processing Loop (#5765)
99
- Fix memory leak in SessionReplayIntegration (#5770)
1010
- Fix reporting of energy used while profiling (#5768)
11+
- Fix linking with SentrySwiftUI on Xcode 26 for visionOS (#5823)
1112

1213
### Internal
1314

Package@swift-5.9.swift

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// swift-tools-version:5.9
2+
#if canImport(Darwin)
3+
import Darwin.C
4+
#elseif canImport(Glibc)
5+
import Glibc
6+
#elseif canImport(MSVCRT)
7+
import MSVCRT
8+
#endif
9+
10+
import PackageDescription
11+
12+
var products: [Product] = [
13+
.library(name: "Sentry", targets: ["Sentry"]),
14+
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
15+
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI"])
16+
]
17+
18+
var targets: [Target] = [
19+
.binaryTarget(
20+
name: "Sentry",
21+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.54.0/Sentry.xcframework.zip",
22+
checksum: "f0f4b5582f7fef029ddedd22b6b9894a6d2d31ea9c7b52a2133b1ec7c4cff206" //Sentry-Static
23+
),
24+
.binaryTarget(
25+
name: "Sentry-Dynamic",
26+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.54.0/Sentry-Dynamic.xcframework.zip",
27+
checksum: "2cd3ee298133ed3a6d3b98f3b040e5c67b752887e67647ae671f450ecfd3facf" //Sentry-Dynamic
28+
),
29+
.target (
30+
name: "SentrySwiftUI",
31+
dependencies: ["Sentry", "SentryInternal"],
32+
path: "Sources/SentrySwiftUI",
33+
exclude: ["SentryInternal/", "module.modulemap"],
34+
swiftSettings: [
35+
.interoperabilityMode(.Cxx, .when(platforms: [.visionOS]))
36+
],
37+
linkerSettings: [
38+
.linkedFramework("Sentry")
39+
]),
40+
.target(
41+
name: "SentryInternal",
42+
path: "Sources/SentrySwiftUI",
43+
sources: [
44+
"SentryInternal/"
45+
],
46+
publicHeadersPath: "SentryInternal/")
47+
]
48+
49+
let env = getenv("EXPERIMENTAL_SPM_BUILDS")
50+
if let env = env, String(cString: env) == "1" {
51+
products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"]))
52+
targets.append(contentsOf: [
53+
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
54+
.target(
55+
name: "SentryHeaders",
56+
path: "Sources/Sentry",
57+
sources: ["SentryDummyPublicEmptyClass.m"],
58+
publicHeadersPath: "Public"
59+
),
60+
.target(
61+
name: "_SentryPrivate",
62+
dependencies: ["SentryHeaders"],
63+
path: "Sources/Sentry",
64+
sources: ["SentryDummyPrivateEmptyClass.m"],
65+
publicHeadersPath: "include",
66+
cSettings: [.headerSearchPath("include/HybridPublic")]),
67+
.target(
68+
name: "SentrySwift",
69+
dependencies: ["_SentryPrivate", "SentryHeaders"],
70+
path: "Sources/Swift",
71+
swiftSettings: [
72+
.unsafeFlags(["-enable-library-evolution"]),
73+
// Some API breaking changes are necessary for the framework to compile with SPM, we’ll ship
74+
// those in V9.
75+
.define("SDK_V9")
76+
]),
77+
.target(
78+
name: "SentryObjc",
79+
dependencies: ["SentrySwift"],
80+
path: "Sources",
81+
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration"],
82+
publicHeadersPath: "",
83+
cSettings: [
84+
.headerSearchPath("Sentry/include/HybridPublic"),
85+
.headerSearchPath("Sentry"),
86+
.headerSearchPath("SentryCrash/Recording"),
87+
.headerSearchPath("SentryCrash/Recording/Monitors"),
88+
.headerSearchPath("SentryCrash/Recording/Tools"),
89+
.headerSearchPath("SentryCrash/Installations"),
90+
.headerSearchPath("SentryCrash/Reporting/Filters"),
91+
.headerSearchPath("SentryCrash/Reporting/Filters/Tools"),
92+
.define("SDK_V9")])
93+
])
94+
}
95+
96+
let package = Package(
97+
name: "Sentry",
98+
platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4), .visionOS(.v1)],
99+
products: products,
100+
targets: targets,
101+
cxxLanguageStandard: .cxx14
102+
)

0 commit comments

Comments
 (0)