Skip to content

Commit ea23f05

Browse files
committed
feat: Add SentryDistribution
1 parent 4f5b2c9 commit ea23f05

File tree

20 files changed

+482
-3
lines changed

20 files changed

+482
-3
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ jobs:
9898
config: DebugV9
9999
- scheme: iOS-ObjectiveC
100100
config: DebugV9
101+
- scheme: DistributionSample
102+
config: Debug
101103

102104
steps:
103105
- uses: actions/checkout@v5
@@ -129,6 +131,26 @@ jobs:
129131
if: ${{ failure() || cancelled() }}
130132
run: ./scripts/ci-diagnostics.sh
131133

134+
build-distribution:
135+
name: Build the distribution framework
136+
runs-on: macos-15
137+
needs: files-changed
138+
steps:
139+
- uses: actions/checkout@v5
140+
141+
- run: ./scripts/ci-select-xcode.sh 16.4
142+
shell: sh
143+
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
144+
- run: set -o pipefail && NSUnbufferedIO=YES xcodebuild build -scheme SentryDistribution -sdk iphoneos -destination 'generic/platform=iphoneos' | tee raw-build-output-spm.log | xcbeautify
145+
shell: sh
146+
- name: Upload SPM Build Logs
147+
uses: actions/upload-artifact@v4
148+
if: ${{ failure() || cancelled() }}
149+
with:
150+
name: raw-build-output-spm
151+
path: |
152+
raw-build-output-spm.log
153+
132154
build-spm:
133155
name: Build with SPM
134156
runs-on: macos-15
@@ -340,6 +362,8 @@ jobs:
340362
files-changed,
341363
ios-swift-release,
342364
build-sample,
365+
build-distribution,
366+
build-distribution-sample,
343367
build-spm,
344368
build-v9,
345369
check-debug-without-UIKit,

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ jobs:
9292
if: failure()
9393
run: ./scripts/ci-diagnostics.sh
9494

95+
distribution-tests:
96+
name: Distribution Tests
97+
runs-on: macos-15
98+
needs: files-changed
99+
steps:
100+
- uses: actions/checkout@v5
101+
- run: rm -r Sentry.xcodeproj && rm -r Sentry.xcworkspace
102+
- run: set -o pipefail && NSUnbufferedIO=YES xcodebuild test -scheme SentryDistributionTests -sdk iphoneos -destination 'generic/platform=iphoneos' | tee raw-test-output-spm.log | xcbeautify
103+
shell: sh
104+
- name: Upload SPM Test Logs
105+
uses: actions/upload-artifact@v4
106+
if: ${{ failure() || cancelled() }}
107+
with:
108+
name: raw-test-output-spm
109+
path: |
110+
raw-test-output-spm.log
111+
95112
unit-tests:
96113
name: Unit ${{matrix.name}}
97114
runs-on: ${{matrix.runs-on}}
@@ -351,6 +368,7 @@ jobs:
351368
[
352369
files-changed,
353370
build-test-server,
371+
distribution-tests,
354372
unit-tests,
355373
]
356374
name: Unit Tests

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,4 @@ xcode-ci:
189189
xcodegen --spec Samples/watchOS-Swift/watchOS-Swift.yml
190190
xcodegen --spec TestSamples/SwiftUITestSample/SwiftUITestSample.yml
191191
xcodegen --spec TestSamples/SwiftUICrashTest/SwiftUICrashTest.yml
192+
xcodegen --spec Samples/DistributionSample/DistributionSample.yml

Package.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ var products: [Product] = [
1515
.library(name: "Sentry-Dynamic-WithARM64e", targets: ["Sentry-Dynamic-WithARM64e"]),
1616
.library(name: "Sentry-WithoutUIKitOrAppKit", targets: ["Sentry-WithoutUIKitOrAppKit", "SentryCppHelper"]),
1717
.library(name: "Sentry-WithoutUIKitOrAppKit-WithARM64e", targets: ["Sentry-WithoutUIKitOrAppKit-WithARM64e", "SentryCppHelper"]),
18-
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI", "SentryCppHelper"])
18+
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI", "SentryCppHelper"]),
19+
.library(name: "SentryDistribution", targets: ["SentryDistribution"])
1920
]
2021

2122
var targets: [Target] = [
@@ -66,7 +67,9 @@ var targets: [Target] = [
6667
linkerSettings: [
6768
.linkedLibrary("c++")
6869
]
69-
)
70+
),
71+
.target(name: "SentryDistribution", path: "Sources/SentryDistribution"),
72+
.testTarget(name: "SentryDistributionTests", path: "Sources/SentryDistributionTests")
7073
]
7174

7275
let env = getenv("EXPERIMENTAL_SPM_BUILDS")
@@ -101,7 +104,7 @@ if let env = env, String(cString: env, encoding: .utf8) == "1" {
101104
name: "SentryObjc",
102105
dependencies: ["SentrySwift"],
103106
path: "Sources",
104-
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration", "SentryCppHelper"],
107+
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration", "SentryCppHelper", "Distribution"],
105108
cSettings: [
106109
.headerSearchPath("Sentry/include/HybridPublic"),
107110
.headerSearchPath("Sentry"),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PRODUCT_BUNDLE_IDENTIFIER = io.sentry.DistributionSample
2+
INFOPLIST_FILE = DistributionSample/Info.plist
3+
SUPPORTED_PLATFORMS = iphoneos iphonesimulator
4+
IPHONEOS_DEPLOYMENT_TARGET = 15.0
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: DistributionSample
2+
createIntermediateGroups: true
3+
generateEmptyDirectories: true
4+
configs:
5+
Debug: debug
6+
Release: release
7+
options:
8+
bundleIdPrefix: io.sentry
9+
packages:
10+
Sentry:
11+
path: ../../
12+
targets:
13+
DistributionSample:
14+
type: application
15+
platform: auto
16+
sources:
17+
- DistributionSample
18+
dependencies:
19+
- package: Sentry
20+
products:
21+
- SentryDistribution
22+
configFiles:
23+
Debug: DistributionSample.xcconfig
24+
Release: DistributionSample.xcconfig
25+
schemes:
26+
DistributionSample:
27+
templates:
28+
- SampleAppScheme
29+
build:
30+
targets:
31+
DistributionSample: all
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import SwiftUI
2+
3+
@main
4+
struct DemoAppApp: App {
5+
var body: some Scene {
6+
WindowGroup {
7+
ContentView()
8+
}
9+
}
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
3+
enum Constants {
4+
static let accessToken = ""
5+
static let organization = ""
6+
static let project = ""
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import SwiftUI
2+
3+
struct ContentView: View {
4+
var body: some View {
5+
VStack(spacing: 20.0) {
6+
Button("Check For Update Swift") {
7+
UpdateUtil.checkForUpdates()
8+
}
9+
.padding()
10+
.background(.blue)
11+
.foregroundColor(.white)
12+
.cornerRadius(10)
13+
}
14+
.padding()
15+
}
16+
}
17+
18+
#Preview {
19+
ContentView()
20+
}
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)