-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Package.swift
233 lines (225 loc) · 9.71 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "DependencyGraph",
platforms: [.macOS(.v12)],
products: [
.executable(name: "dependency-graph", targets: ["Main"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0"),
.package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.8.0"))
],
targets: [
.executableTarget(name: "Main", dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"D2GraphMapper",
"DirectedGraphMapper",
"DirectedGraphWriter",
"DOTGraphMapper",
"DumpPackageService",
"DumpPackageServiceLive",
"FileSystem",
"FileSystemLive",
"GraphCommand",
"MappingDirectedGraphWriter",
"MermaidGraphMapper",
"PackageGraphBuilder",
"PackageGraphBuilderLive",
"PackageSwiftFileParser",
"PackageSwiftFileParserCache",
"PackageSwiftFileParserCacheLive",
"PackageSwiftFileParserLive",
"ProjectRootClassifier",
"ProjectRootClassifierLive",
"ShellCommandRunner",
"ShellCommandRunnerLive",
"StdoutWriter",
"XcodeProjectGraphBuilder",
"XcodeProjectGraphBuilderLive",
"XcodeProjectParser",
"XcodeProjectParserLive"
]),
// Sources/Library/Commands
.target(name: "GraphCommand", dependencies: [
"DirectedGraphMapper",
"DirectedGraphWriter",
"PackageGraphBuilder",
"PackageSwiftFileParser",
"ProjectRootClassifier",
"XcodeProjectParser",
"XcodeProjectGraphBuilder"
], path: "Sources/Library/Commands/GraphCommand"),
// Sources/Library/Graphing
.target(name: "D2GraphMapper", dependencies: [
"DirectedGraph",
"DirectedGraphMapper",
"StringIndentHelpers"
], path: "Sources/Library/Graphing/D2GraphMapper"),
.target(name: "DirectedGraph", path: "Sources/Library/Graphing/DirectedGraph"),
.target(name: "DirectedGraphXcodeHelpers", dependencies: [
"DirectedGraph"
], path: "Sources/Library/Graphing/DirectedGraphXcodeHelpers"),
.target(name: "DirectedGraphMapper", dependencies: [
"DirectedGraph"
], path: "Sources/Library/Graphing/DirectedGraphMapper"),
.target(name: "DOTGraphMapper", dependencies: [
"DirectedGraph",
"DirectedGraphMapper",
"StringIndentHelpers"
], path: "Sources/Library/Graphing/DOTGraphMapper"),
.target(name: "MermaidGraphMapper", dependencies: [
"DirectedGraph",
"DirectedGraphMapper",
"StringIndentHelpers"
], path: "Sources/Library/Graphing/MermaidGraphMapper"),
.target(name: "PackageGraphBuilder", dependencies: [
"DirectedGraph",
"PackageSwiftFile"
], path: "Sources/Library/Graphing/PackageGraphBuilder"),
.target(name: "PackageGraphBuilderLive", dependencies: [
"DirectedGraph",
"DirectedGraphXcodeHelpers",
"PackageGraphBuilder",
"PackageSwiftFile"
], path: "Sources/Library/Graphing/PackageGraphBuilderLive"),
.target(name: "XcodeProjectGraphBuilder", dependencies: [
"DirectedGraph",
"PackageGraphBuilder",
"XcodeProject"
], path: "Sources/Library/Graphing/XcodeProjectGraphBuilder"),
.target(name: "XcodeProjectGraphBuilderLive", dependencies: [
"DirectedGraph",
"DirectedGraphXcodeHelpers",
"PackageGraphBuilder",
"PackageSwiftFile",
"PackageSwiftFileParser",
"XcodeProjectGraphBuilder",
"XcodeProject"
], path: "Sources/Library/Graphing/XcodeProjectGraphBuilderLive"),
// Sources/Library/Parsing
.target(name: "DumpPackageService", path: "Sources/Library/Parsing/DumpPackageService"),
.target(name: "DumpPackageServiceLive", dependencies: [
"DumpPackageService",
"ShellCommandRunner"
], path: "Sources/Library/Parsing/DumpPackageServiceLive"),
.target(name: "PackageSwiftFile", path: "Sources/Library/Parsing/PackageSwiftFile"),
.target(name: "PackageSwiftFileParser", dependencies: [
"PackageSwiftFile"
], path: "Sources/Library/Parsing/PackageSwiftFileParser"),
.target(name: "PackageSwiftFileParserCache", dependencies: [
"PackageSwiftFile"
], path: "Sources/Library/Parsing/PackageSwiftFileParserCache"),
.target(name: "PackageSwiftFileParserCacheLive", dependencies: [
"PackageSwiftFile",
"PackageSwiftFileParserCache"
], path: "Sources/Library/Parsing/PackageSwiftFileParserCacheLive"),
.target(name: "PackageSwiftFileParserLive", dependencies: [
"DumpPackageService",
"PackageSwiftFile",
"PackageSwiftFileParser",
"PackageSwiftFileParserCache"
], path: "Sources/Library/Parsing/PackageSwiftFileParserLive"),
.target(name: "ProjectRootClassifier", path: "Sources/Library/Parsing/ProjectRootClassifier"),
.target(name: "ProjectRootClassifierLive", dependencies: [
"FileSystem",
"ProjectRootClassifier"
], path: "Sources/Library/Parsing/ProjectRootClassifierLive"),
.target(name: "XcodeProject", path: "Sources/Library/Parsing/XcodeProject"),
.target(name: "XcodeProjectParser", dependencies: [
"XcodeProject"
], path: "Sources/Library/Parsing/XcodeProjectParser"),
.target(name: "XcodeProjectParserLive", dependencies: [
"FileSystem",
.product(name: "XcodeProj", package: "XcodeProj"),
"XcodeProject",
"XcodeProjectParser"
], path: "Sources/Library/Parsing/XcodeProjectParserLive"),
// Sources/Library/Outputting
.target(name: "DirectedGraphWriter", dependencies: [
"DirectedGraph",
"Writer"
], path: "Sources/Library/Outputting/DirectedGraphWriter"),
.target(name: "MappingDirectedGraphWriter", dependencies: [
"DirectedGraph",
"DirectedGraphMapper",
"DirectedGraphWriter"
], path: "Sources/Library/Outputting/MappingDirectedGraphWriter"),
.target(name: "StdoutWriter", dependencies: [
"Writer"
], path: "Sources/Library/Outputting/StdoutWriter"),
.target(name: "Writer", path: "Sources/Library/Outputting/Writer"),
// Sources/Library/Utilities
.target(name: "FileSystem", path: "Sources/Library/Utilities/FileSystem"),
.target(name: "FileSystemLive", dependencies: [
"FileSystem"
], path: "Sources/Library/Utilities/FileSystemLive"),
.target(name: "ShellCommandRunner", path: "Sources/Library/Utilities/ShellCommandRunner"),
.target(name: "ShellCommandRunnerLive", dependencies: [
"ShellCommandRunner"
], path: "Sources/Library/Utilities/ShellCommandRunnerLive"),
.target(name: "StringIndentHelpers", path: "Sources/Library/Utilities/StringIndentHelpers"),
// Tests
.testTarget(name: "D2GraphMapperTests", dependencies: [
"DirectedGraph",
"D2GraphMapper"
]),
.testTarget(name: "DirectedGraphTests", dependencies: [
"DirectedGraph"
]),
.testTarget(name: "DirectedGraphXcodeHelpersTests", dependencies: [
"DirectedGraphXcodeHelpers"
]),
.testTarget(name: "DOTGraphMapperTests", dependencies: [
"DirectedGraph",
"DOTGraphMapper"
]),
.testTarget(name: "DumpPackageServiceLiveTests", dependencies: [
"DumpPackageServiceLive",
"ShellCommandRunner"
]),
.testTarget(name: "GraphCommandTests", dependencies: [
"GraphCommand"
]),
.testTarget(name: "MappingDirectedGraphWriterTests", dependencies: [
"MappingDirectedGraphWriter"
]),
.testTarget(name: "MermaidGraphMapperTests", dependencies: [
"DirectedGraph",
"MermaidGraphMapper"
]),
.testTarget(name: "PackageGraphBuilderLiveTests", dependencies: [
"DirectedGraph",
"DirectedGraphXcodeHelpers",
"PackageGraphBuilderLive",
"PackageSwiftFile"
]),
.testTarget(name: "PackageSwiftFileParserLiveTests", dependencies: [
"DumpPackageService",
"PackageSwiftFileParser",
"PackageSwiftFileParserCache",
"PackageSwiftFileParserLive"
], resources: [.copy("MockData")]),
.testTarget(name: "ProjectRootClassifierLiveTests", dependencies: [
"FileSystem",
"ProjectRootClassifierLive"
]),
.testTarget(name: "StringIndentHelpersTests", dependencies: [
"StringIndentHelpers"
]),
.testTarget(name: "XcodeProjectGraphBuilderLiveTests", dependencies: [
"DirectedGraph",
"DirectedGraphXcodeHelpers",
"PackageGraphBuilder",
"PackageSwiftFileParser",
"XcodeProjectGraphBuilderLive",
"XcodeProject"
]),
.testTarget(name: "XcodeProjectParserLiveTests", dependencies: [
"FileSystem",
"XcodeProject",
"XcodeProjectParserLive"
], resources: [.copy("Example")])
]
)