-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
76 lines (76 loc) · 2.36 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
// swift-tools-version:5.5
import PackageDescription
import Foundation
let package = Package(
name: "Clockwork",
platforms: [.macOS(.v11)],
products: [.executable(name: "clockwork", targets: ["Clockwork"])],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.0.1"),
.package(url: "https://github.com/jpsim/Yams.git", from: "4.0.2"),
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
.package(url: "https://github.com/stencilproject/Stencil.git", from: "0.15.1"),
.package(url: "https://github.com/SwiftUtility/Utility", from: "0.0.7"),
],
targets: [
.executableTarget(
name: "Clockwork",
dependencies: .assembly + [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Sources/Assembly"
),
.testTarget(name: "Tests", dependencies: .assembly, path: "Tests"),
.interactivity("PathKit", extra: [
"PathKit",
"InteractivityCommon",
]),
.interactivity("Yams", extra: [
"Yams",
]),
.interactivity("Stencil", extra: [
"Stencil",
]),
.interactivity("Common"),
.facility("Fair", extra: ["FacilityPure"]),
.facility("Pure"),
]
)
extension Target {
static func interactivity(_ name: String, extra dependencies: [Dependency] = []) -> Target {
utility("Interactivity", name, dependencies + .interactivity + .facilities + .facility)
}
static func facility(_ name: String, extra dependencies: [Dependency] = []) -> Target {
utility("Facility", name, dependencies + .facility)
}
private static func utility(
_ layer: String,
_ name: String,
_ dependencies: [Dependency]
) -> Target {
self.target(
name: "\(layer)\(name)",
dependencies: dependencies,
path: "Sources/\(layer)/\(name)"
)
}
}
extension Array where Element == Target.Dependency {
static let assembly: Self = facility + facilities + interactivity + interactivities
static let interactivities: Self = [
"InteractivityCommon",
"InteractivityPathKit",
"InteractivityStencil",
"InteractivityYams",
]
static let interactivity: Self = [
.product(name: "Interactivity", package: "Utility"),
]
static let facilities: Self = [
"FacilityFair",
"FacilityPure",
]
static let facility: Self = [
.product(name: "Facility", package: "Utility")
]
}