Skip to content

Commit 1f2bfe3

Browse files
committed
feat: Add SPM sample
1 parent 9db5cb3 commit 1f2bfe3

File tree

14 files changed

+233
-3
lines changed

14 files changed

+233
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Samples/visionOS-Swift/visionOS-Swift.xcodeproj
9595
Samples/watchOS-Swift/watchOS-Swift.xcodeproj
9696
Samples/SentrySampleShared/SentrySampleShared.xcodeproj
9797
Samples/DistributionSample/DistributionSample.xcodeproj
98+
Samples/SPM/SPM.xcodeproj
9899
TestSamples/SwiftUITestSample/SwiftUITestSample.xcodeproj
99100
TestSamples/SwiftUICrashTest/SwiftUICrashTest.xcodeproj
100101

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ xcode:
184184
open Sentry.xcworkspace
185185

186186
xcode-ci:
187+
xcodegen --spec Samples/SPM/SPM.yml
187188
xcodegen --spec Samples/SentrySampleShared/SentrySampleShared.yml
188189
xcodegen --spec Samples/SessionReplay-CameraTest/SessionReplay-CameraTest.yml
189190
xcodegen --spec Samples/iOS-ObjectiveC/iOS-ObjectiveC.yml

Package.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ var targets: [Target] = [
8383
.testTarget(name: "SentryDistributionTests", dependencies: ["SentryDistribution"], path: "Sources/SentryDistributionTests")
8484
]
8585

86-
let env = getenv("EXPERIMENTAL_SPM_BUILDS")
87-
if let env = env, String(cString: env, encoding: .utf8) == "1" {
8886
products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"]))
8987
targets.append(contentsOf: [
9088
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
@@ -123,7 +121,6 @@ if let env = env, String(cString: env, encoding: .utf8) == "1" {
123121
.headerSearchPath("SentryCrash/Reporting/Filters"),
124122
.headerSearchPath("SentryCrash/Reporting/Filters/Tools")])
125123
])
126-
}
127124

128125
let package = Package(
129126
name: "Sentry",

Samples/SPM/SPM.xcconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "../Shared/Config/_Common.xcconfig"
2+
3+
PRODUCT_BUNDLE_IDENTIFIER = io.sentry.sample.SPM
4+
INFOPLIST_FILE = SPM/Info.plist
5+
CODE_SIGN_ENTITLEMENTS = SPM/SPM.entitlements
6+
7+
PROVISIONING_PROFILE_SPECIFIER_Debug = match Development io.sentry.sample.SPM
8+
PROVISIONING_PROFILE_SPECIFIER_Release = match AppStore io.sentry.sample.SPM
9+
PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*] = $(PROVISIONING_PROFILE_SPECIFIER_$(CONFIGURATION))
10+
PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
11+
12+
CODE_SIGN_STYLE = Manual
13+
14+
SUPPORTED_PLATFORMS = iphoneos iphonesimulator

Samples/SPM/SPM.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=../../schema/xcodegen.schema.json
2+
3+
name: SPM
4+
createIntermediateGroups: true
5+
generateEmptyDirectories: true
6+
configs:
7+
Debug: debug
8+
Release: release
9+
fileGroups:
10+
- SPM.yml
11+
options:
12+
bundleIdPrefix: io.sentry
13+
packages:
14+
Sentry:
15+
path: ../../
16+
targets:
17+
SPM:
18+
type: application
19+
platform: auto
20+
sources:
21+
- SPM
22+
dependencies:
23+
- package: Sentry
24+
products:
25+
- SentrySwift
26+
configFiles:
27+
Debug: SPM.xcconfig
28+
Release: SPM.xcconfig
29+
schemes:
30+
SPM:
31+
templates:
32+
- SampleAppScheme
33+
build:
34+
targets:
35+
SPM: all
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors": [
3+
{
4+
"idiom": "universal"
5+
}
6+
],
7+
"info": {
8+
"author": "xcode",
9+
"version": 1
10+
}
11+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images": [
3+
{
4+
"idiom": "universal",
5+
"platform": "ios",
6+
"size": "1024x1024"
7+
},
8+
{
9+
"appearances": [
10+
{
11+
"appearance": "luminosity",
12+
"value": "dark"
13+
}
14+
],
15+
"idiom": "universal",
16+
"platform": "ios",
17+
"size": "1024x1024"
18+
},
19+
{
20+
"appearances": [
21+
{
22+
"appearance": "luminosity",
23+
"value": "tinted"
24+
}
25+
],
26+
"idiom": "universal",
27+
"platform": "ios",
28+
"size": "1024x1024"
29+
}
30+
],
31+
"info": {
32+
"author": "xcode",
33+
"version": 1
34+
}
35+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info": {
3+
"author": "xcode",
4+
"version": 1
5+
}
6+
}

Samples/SPM/SPM/ContentView.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// ContentView.swift
3+
// SPMTest
4+
//
5+
// Created by Noah Martin on 10/15/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ContentView: View {
11+
var body: some View {
12+
VStack {
13+
Image(systemName: "globe")
14+
.imageScale(.large)
15+
.foregroundStyle(.tint)
16+
Text("Hello, world!")
17+
}
18+
.padding()
19+
}
20+
}
21+
22+
#Preview {
23+
ContentView()
24+
}

Samples/SPM/SPM/Info.plist

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
<key>GIT_BRANCH</key>
22+
<string>&lt;branch&gt;</string>
23+
<key>GIT_COMMIT_HASH</key>
24+
<string>&lt;sha&gt;</string>
25+
<key>GIT_STATUS_CLEAN</key>
26+
<string>&lt;status&gt;</string>
27+
<key>LSRequiresIPhoneOS</key>
28+
<true/>
29+
<key>UIApplicationSceneManifest</key>
30+
<dict>
31+
<key>UIApplicationSupportsMultipleScenes</key>
32+
<true/>
33+
</dict>
34+
<key>UIApplicationSupportsIndirectInputEvents</key>
35+
<true/>
36+
<key>UILaunchScreen</key>
37+
<dict/>
38+
<key>UIRequiredDeviceCapabilities</key>
39+
<array>
40+
<string>armv7</string>
41+
</array>
42+
<key>UISupportedInterfaceOrientations</key>
43+
<array>
44+
<string>UIInterfaceOrientationPortrait</string>
45+
<string>UIInterfaceOrientationLandscapeLeft</string>
46+
<string>UIInterfaceOrientationLandscapeRight</string>
47+
</array>
48+
<key>UISupportedInterfaceOrientations~ipad</key>
49+
<array>
50+
<string>UIInterfaceOrientationPortrait</string>
51+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
52+
<string>UIInterfaceOrientationLandscapeLeft</string>
53+
<string>UIInterfaceOrientationLandscapeRight</string>
54+
</array>
55+
</dict>
56+
</plist>

0 commit comments

Comments
 (0)