-
Notifications
You must be signed in to change notification settings - Fork 15
142 lines (136 loc) · 3.57 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// swift-tools-version:5.6
import PackageDescription
import Foundation
let swiftSyntax: Package.Dependency = {
let url = "https://github.com/apple/swift-syntax"
#if swift(>=5.9)
#warning("""
Orion does not officially support this version of Swift yet. \
Please check https://github.com/theos/Orion for progress updates.
""")
#endif
#if swift(>=5.8)
return .package(url: url, from: "508.0.0")
#elseif swift(>=5.7)
return .package(url: url, exact: "0.50700.0")
#elseif swift(>=5.6)
return .package(url: url, exact: "0.50600.1")
#else
#error("""
Internal error: Swift Package Manager should be reading from
Package.swift, not [email protected].
""")
#endif
}()
let macPlatform: SupportedPlatform = {
#if swift(>=5.8)
return .macOS("10.15")
#else
return .macOS("10.12")
#endif
}()
var package = Package(
name: "Orion",
platforms: [macPlatform],
products: [
.library(
name: "OrionProcessor",
targets: ["OrionProcessor"]
),
.executable(
name: "OrionCLI",
targets: ["OrionCLI"]
),
.plugin(
name: "OrionPlugin",
targets: ["OrionPlugin"]
),
],
dependencies: [
swiftSyntax,
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
],
targets: [
.target(
name: "OrionProcessor",
dependencies: [
.product(name: "SwiftSyntaxParser", package: "swift-syntax")
]
),
.executableTarget(
name: "OrionCLI",
dependencies: [
"OrionProcessor",
.product(name: "ArgumentParser", package: "swift-argument-parser")
]
),
.testTarget(
name: "OrionProcessorTests",
dependencies: ["OrionProcessor"]
),
.plugin(
name: "OrionPlugin",
capability: .buildTool(),
dependencies: ["OrionCLI"]
),
]
)
#if canImport(ObjectiveC)
if ProcessInfo.processInfo.environment["SPM_THEOS_BUILD"] != "1" {
package.products += [
.library(
name: "Orion",
targets: ["Orion"]
),
.library(
name: "CydiaSubstrate",
targets: ["CydiaSubstrate"]
),
.library(
name: "OrionBackend_Substrate",
targets: ["OrionBackend_Substrate"]
),
.executable(
name: "OrionPlayground",
targets: ["OrionPlayground"]
),
]
package.targets += [
.target(
name: "OrionC",
dependencies: []
),
.target(
name: "Orion",
dependencies: ["OrionC"]
),
.systemLibrary(
name: "CydiaSubstrate"
),
.target(
name: "OrionBackend_Substrate",
dependencies: ["CydiaSubstrate", "Orion"]
),
.target(
name: "Fishhook"
),
.target(
name: "OrionBackend_Fishhook",
dependencies: ["Fishhook", "Orion"]
),
.executableTarget(
name: "OrionPlayground",
dependencies: ["Orion", "OrionTestSupport"]
),
.target(
name: "OrionTestSupport",
dependencies: ["Orion"]
),
.testTarget(
name: "OrionTests",
dependencies: ["Orion", "OrionBackend_Fishhook", "OrionTestSupport"],
plugins: ["OrionPlugin"]
),
]
}
#endif