-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
88 lines (75 loc) · 2.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
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
// MARK: - Externals
let swiftXML = Target.Dependency.product(name: "SwiftyXML", package: "SwiftyXML")
let argumentParser = Target.Dependency.product(name: "ArgumentParser", package: "swift-argument-parser")
// MARK: - Internals
// MARK: Utils
let utils = "XCResultScrapperUtils"
let utilsTarget: Target = .target(name: utils, path: path(for: utils))
let utilsTargetDependency: Target.Dependency = .target(name: utils)
// MARK: Domain
let xcResultScrapperDomain = "XCResultScrapperDomain"
let domainTarget: Target = .target(
name: xcResultScrapperDomain,
dependencies: [utilsTargetDependency],
path: path(for: xcResultScrapperDomain)
)
let domainTargetDependency: Target.Dependency = .target(name: xcResultScrapperDomain)
// MARK: Report
let xcresultScrapperReport = "XCResultScrapperReport"
let xcresultScrapperReportTarget: Target = .target(
name: xcresultScrapperReport,
dependencies: [swiftXML, domainTargetDependency],
path: path(for: xcresultScrapperReport)
)
let xcresultScrapperReportDependency: Target.Dependency = .target(name: xcresultScrapperReport)
// MARK: Core
let xcResultScrapper = "XCResultScrapperCore"
let scrapperTarget: Target = .target(
name: xcResultScrapper,
dependencies: [domainTargetDependency, utilsTargetDependency, xcresultScrapperReportDependency],
path: path(for: xcResultScrapper)
)
let scrapperTargetDependency: Target.Dependency = .target(name: xcResultScrapper)
// MARK: Client
let xcResultScrapperClient = "XCResultScrapperClient"
let scrapperClientTarget: Target = .executableTarget(
name: xcResultScrapperClient,
dependencies: [scrapperTargetDependency, argumentParser],
path: path(for: xcResultScrapperClient)
)
// MARK: - Manifest
let package = Package(
name: "XCResultScrapper",
products: [
.library(
name: "XCResultScrapper",
targets: [xcResultScrapper]
),
.executable(
name: xcResultScrapperClient,
targets: [xcResultScrapperClient]
)
],
dependencies: [
.package(url: "https://github.com/SergeyPetrachkov/SwiftyXML", branch: "master"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.2")
],
targets: [
utilsTarget,
domainTarget,
scrapperTarget,
xcresultScrapperReportTarget,
scrapperClientTarget,
.testTarget(
name: "XCResultScrapperTests",
dependencies: ["XCResultScrapperCore"]
)
]
)
// MARK: - Private helpers
func path(for target: String) -> String {
"Sources/\(target)"
}