-
-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathPackage@swift-6.1.swift
More file actions
123 lines (116 loc) · 5.3 KB
/
Package@swift-6.1.swift
File metadata and controls
123 lines (116 loc) · 5.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// swift-tools-version:6.1
#if canImport(Darwin)
import Darwin.C
#elseif canImport(Glibc)
import Glibc
#elseif canImport(MSVCRT)
import MSVCRT
#endif
import PackageDescription
var products: [Product] = [
.library(name: "Sentry", targets: ["Sentry", "SentryCppHelper"]),
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
.library(name: "Sentry-Dynamic-WithARM64e", targets: ["Sentry-Dynamic-WithARM64e"]),
.library(name: "Sentry-WithoutUIKitOrAppKit", targets: ["Sentry-WithoutUIKitOrAppKit", "SentryCppHelper"]),
.library(name: "Sentry-WithoutUIKitOrAppKit-WithARM64e", targets: ["Sentry-WithoutUIKitOrAppKit-WithARM64e", "SentryCppHelper"]),
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI", "SentryCppHelper"]),
.library(name: "SentryDistribution", targets: ["SentryDistribution"])
]
var targets: [Target] = [
.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry.xcframework.zip",
checksum: "166692d02bb59fe9a158fe59b16e122fda40dddf6deaabed65a9e4b240f84c9b" //Sentry-Static
),
.binaryTarget(
name: "Sentry-Dynamic",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-Dynamic.xcframework.zip",
checksum: "1dd70512f3b5af6c74f1b8f11279531900173fb638d7d541320a7cbc00ed06bc" //Sentry-Dynamic
),
.binaryTarget(
name: "Sentry-Dynamic-WithARM64e",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-Dynamic-WithARM64e.xcframework.zip",
checksum: "7d981d7ad0686c5fd68c791b721820a360285dc711e2b23e79114a6a62d799a6" //Sentry-Dynamic-WithARM64e
),
.binaryTarget(
name: "Sentry-WithoutUIKitOrAppKit",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-WithoutUIKitOrAppKit.xcframework.zip",
checksum: "8c70de11731587e2c615089464820b67d8f0103b5e019d81a16b0cac31e33e65" //Sentry-WithoutUIKitOrAppKit
),
.binaryTarget(
name: "Sentry-WithoutUIKitOrAppKit-WithARM64e",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip",
checksum: "abd3b0836ce6637cbc274e7d979b345ec3c2f46857d5412e78c1d2f0fe3397b0" //Sentry-WithoutUIKitOrAppKit-WithARM64e
),
.target(
name: "SentrySwiftUI",
dependencies: ["Sentry"],
path: "Sources/SentrySwiftUI",
exclude: ["module.modulemap"],
linkerSettings: [
.linkedFramework("Sentry")
]
),
.target(
name: "SentryCppHelper",
path: "Sources/SentryCppHelper",
linkerSettings: [
.linkedLibrary("c++")
]
),
.target(name: "SentryDistribution", path: "Sources/SentryDistribution"),
.testTarget(name: "SentryDistributionTests", dependencies: ["SentryDistribution"], path: "Sources/SentryDistributionTests")
]
// Targets required to support compile-from-source builds via SPM.
products.append(.library(name: "SentrySPM", targets: ["SentryObjCInternal"]))
targets += [
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
.target(
name: "SentryHeaders",
path: "Sources/Sentry",
sources: ["SentryDummyPublicEmptyClass.m"],
publicHeadersPath: "Public"
),
.target(
name: "_SentryPrivate",
dependencies: ["SentryHeaders"],
path: "Sources/Sentry",
sources: ["SentryDummyPrivateEmptyClass.m"],
publicHeadersPath: "include"),
.target(
name: "SentrySwift",
dependencies: ["_SentryPrivate", "SentryHeaders"],
path: "Sources/Swift",
swiftSettings: [
.unsafeFlags(["-enable-library-evolution"]),
.define("SENTRY_NO_UI_FRAMEWORK", .when(traits: ["NoUIFramework"]))
]),
// SentryObjCInternal compiles all ObjC/C sources from the repo. Named "Internal"
// to reserve "SentryObjC" for a future public Objective-C wrapper around the SDK.
.target(
name: "SentryObjCInternal",
dependencies: ["SentrySwift"],
path: "Sources",
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration", "SentryCppHelper", "SentryDistribution", "SentryDistributionTests"],
cSettings: [
.headerSearchPath("Sentry"),
.headerSearchPath("SentryCrash/Recording"),
.headerSearchPath("SentryCrash/Recording/Monitors"),
.headerSearchPath("SentryCrash/Recording/Tools"),
.headerSearchPath("SentryCrash/Installations"),
.headerSearchPath("SentryCrash/Reporting/Filters"),
.headerSearchPath("SentryCrash/Reporting/Filters/Tools"),
.define("SENTRY_NO_UI_FRAMEWORK", to: "1", .when(traits: ["NoUIFramework"]))
])
]
let package = Package(
name: "Sentry",
platforms: [.iOS(.v15), .macOS(.v10_14), .tvOS(.v15), .watchOS(.v8), .visionOS(.v1)],
products: products,
traits: [
.init(name: "NoUIFramework", description: "Build without UIKit/AppKit framework linkage. Use for command-line tools or contexts where UI frameworks are unavailable.")
],
targets: targets,
swiftLanguageModes: [.v5],
cxxLanguageStandard: .cxx14
)