Skip to content

Commit 2181b05

Browse files
committed
Update package swift file
1 parent 7210241 commit 2181b05

File tree

1 file changed

+40
-43
lines changed

1 file changed

+40
-43
lines changed

Package.swift

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ import MSVCRT
99

1010
import PackageDescription
1111

12-
var products: [Product] = [
12+
let products: [Product] = [
1313
.library(name: "Sentry", targets: ["Sentry", "SentryCppHelper"]),
1414
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
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"]),
1818
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI", "SentryCppHelper"]),
19-
.library(name: "SentryDistribution", targets: ["SentryDistribution"])
19+
.library(name: "SentryDistribution", targets: ["SentryDistribution"]),
20+
.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"])
2021
]
2122

22-
var targets: [Target] = [
23+
let targets: [Target] = [
2324
.binaryTarget(
2425
name: "Sentry",
2526
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.0.0-alpha.0/Sentry.xcframework.zip",
@@ -71,48 +72,44 @@ var targets: [Target] = [
7172
]
7273
),
7374
.target(name: "SentryDistribution", path: "Sources/SentryDistribution"),
74-
.testTarget(name: "SentryDistributionTests", dependencies: ["SentryDistribution"], path: "Sources/SentryDistributionTests")
75+
.testTarget(name: "SentryDistributionTests", dependencies: ["SentryDistribution"], path: "Sources/SentryDistributionTests"),
76+
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
77+
.target(
78+
name: "SentryHeaders",
79+
path: "Sources/Sentry",
80+
sources: ["SentryDummyPublicEmptyClass.m"],
81+
publicHeadersPath: "Public"
82+
),
83+
.target(
84+
name: "_SentryPrivate",
85+
dependencies: ["SentryHeaders"],
86+
path: "Sources/Sentry",
87+
sources: ["SentryDummyPrivateEmptyClass.m"],
88+
publicHeadersPath: "include",
89+
cSettings: [.headerSearchPath("include/HybridPublic")]),
90+
.target(
91+
name: "SentrySwift",
92+
dependencies: ["_SentryPrivate", "SentryHeaders"],
93+
path: "Sources/Swift",
94+
swiftSettings: [
95+
.unsafeFlags(["-enable-library-evolution"])
96+
]),
97+
.target(
98+
name: "SentryObjc",
99+
dependencies: ["SentrySwift"],
100+
path: "Sources",
101+
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration", "SentryCppHelper", "SentryDistribution", "SentryDistributionTests"],
102+
cSettings: [
103+
.headerSearchPath("Sentry/include/HybridPublic"),
104+
.headerSearchPath("Sentry"),
105+
.headerSearchPath("SentryCrash/Recording"),
106+
.headerSearchPath("SentryCrash/Recording/Monitors"),
107+
.headerSearchPath("SentryCrash/Recording/Tools"),
108+
.headerSearchPath("SentryCrash/Installations"),
109+
.headerSearchPath("SentryCrash/Reporting/Filters"),
110+
.headerSearchPath("SentryCrash/Reporting/Filters/Tools")])
75111
]
76112

77-
products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"]))
78-
targets.append(contentsOf: [
79-
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
80-
.target(
81-
name: "SentryHeaders",
82-
path: "Sources/Sentry",
83-
sources: ["SentryDummyPublicEmptyClass.m"],
84-
publicHeadersPath: "Public"
85-
),
86-
.target(
87-
name: "_SentryPrivate",
88-
dependencies: ["SentryHeaders"],
89-
path: "Sources/Sentry",
90-
sources: ["SentryDummyPrivateEmptyClass.m"],
91-
publicHeadersPath: "include",
92-
cSettings: [.headerSearchPath("include/HybridPublic")]),
93-
.target(
94-
name: "SentrySwift",
95-
dependencies: ["_SentryPrivate", "SentryHeaders"],
96-
path: "Sources/Swift",
97-
swiftSettings: [
98-
.unsafeFlags(["-enable-library-evolution"])
99-
]),
100-
.target(
101-
name: "SentryObjc",
102-
dependencies: ["SentrySwift"],
103-
path: "Sources",
104-
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration", "SentryCppHelper", "SentryDistribution", "SentryDistributionTests"],
105-
cSettings: [
106-
.headerSearchPath("Sentry/include/HybridPublic"),
107-
.headerSearchPath("Sentry"),
108-
.headerSearchPath("SentryCrash/Recording"),
109-
.headerSearchPath("SentryCrash/Recording/Monitors"),
110-
.headerSearchPath("SentryCrash/Recording/Tools"),
111-
.headerSearchPath("SentryCrash/Installations"),
112-
.headerSearchPath("SentryCrash/Reporting/Filters"),
113-
.headerSearchPath("SentryCrash/Reporting/Filters/Tools")])
114-
])
115-
116113
let package = Package(
117114
name: "Sentry",
118115
platforms: [.iOS(.v15), .macOS(.v12), .tvOS(.v15), .watchOS(.v8)],

0 commit comments

Comments
 (0)