-
Notifications
You must be signed in to change notification settings - Fork 40
/
Package.swift
165 lines (153 loc) · 6.45 KB
/
Package.swift
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import CompilerPluginSupport
let package = Package(
name: "LiveViewNative",
platforms: [
.iOS("16.0"),
.macOS("13.0"),
.watchOS("9.0"),
.tvOS("16.0"),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "LiveViewNative",
targets: ["LiveViewNative"]),
.library(
name: "LiveViewNativeStylesheet",
targets: ["LiveViewNativeStylesheet"]),
.executable(name: "ModifierGenerator", targets: ["ModifierGenerator"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/scinfu/SwiftSoup.git", from: "2.3.2"),
.package(url: "https://github.com/davidstump/SwiftPhoenixClient.git", .upToNextMinor(from: "5.3.2")),
.package(url: "https://github.com/apple/swift-async-algorithms", from: "0.1.0"),
.package(url: "https://github.com/liveview-native/liveview-native-core-swift.git", exact: "0.2.1"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2"),
.package(url: "https://github.com/swiftlang/swift-markdown.git", from: "0.2.0"),
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "509.0.2"),
.package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.13.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "LiveViewNative",
dependencies: [
"SwiftSoup",
"SwiftPhoenixClient",
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
.product(name: "LiveViewNativeCore", package: "liveview-native-core-swift"),
"LiveViewNativeMacros",
"LiveViewNativeStylesheet"
],
plugins: [
.plugin(name: "BuiltinRegistryGeneratorPlugin")
]
),
.testTarget(
name: "LiveViewNativeTests",
dependencies: ["LiveViewNative"]
),
.testTarget(
name: "RenderingTests",
dependencies: ["LiveViewNative"]
),
.executableTarget(
name: "ModifierGenerator",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftParser", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
]
),
.executableTarget(
name: "BuiltinRegistryGenerator",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]
),
.plugin(
name: "BuiltinRegistryGeneratorPlugin",
capability: .buildTool(),
dependencies: [.target(name: "BuiltinRegistryGenerator")]
),
.executableTarget(
name: "DocumentationExtensionGenerator",
dependencies: [.product(name: "ArgumentParser", package: "swift-argument-parser")]
),
.plugin(
name: "DocumentationExtensionGeneratorPlugin",
capability: .command(
intent: .custom(verb: "generate-documentation-extensions", description: ""),
permissions: [
.writeToPackageDirectory(reason: "This command generates documentation extension markdown files")
]
),
dependencies: [.target(name: "DocumentationExtensionGenerator")]
),
.plugin(
name: "SortDocumentationJSONPlugin",
capability: .command(
intent: .custom(verb: "sort-documentation-json", description: ""),
permissions: [
.writeToPackageDirectory(reason: "This command sorts the JSON files in the docs repo folder")
]
),
dependencies: []
),
// Unfortunately, this tool cannot be a plugin due to limitations on network access.
// Once SwiftPM supports plugins with network access, this can become a plugin again.
.executableTarget(
name: "TutorialRepoGenerator",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "Markdown", package: "swift-markdown"),
]
),
.macro(
name: "LiveViewNativeMacros",
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
),
.testTarget(
name: "LiveViewNativeMacrosTests",
dependencies: [
"LiveViewNativeMacros",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
]
),
.macro(
name: "LiveViewNativeStylesheetMacros",
dependencies: [
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
.product(name: "SwiftCompilerPlugin", package: "swift-syntax")
]
),
.target(
name: "LiveViewNativeStylesheet",
dependencies: [
"LiveViewNativeStylesheetMacros",
.product(name: "LiveViewNativeCore", package: "liveview-native-core-swift"),
.product(name: "Parsing", package: "swift-parsing"),
]
),
.testTarget(
name: "LiveViewNativeStylesheetTests",
dependencies: ["LiveViewNativeStylesheet", "LiveViewNative"]
),
.testTarget(
name: "LiveViewNativeStylesheetMacrosTests",
dependencies: [
"LiveViewNativeStylesheetMacros",
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
]
),
]
)