-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPackage.swift
126 lines (105 loc) · 3.5 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
// swift-tools-version:5.2
import PackageDescription
// MARK: - Dependencies
extension Target.Dependency {
static var bow: Target.Dependency {
.product(name: "Bow", package: "Bow")
}
static var bowEffects: Target.Dependency {
.product(name: "BowEffects", package: "Bow")
}
static var bowOptics: Target.Dependency {
.product(name: "BowOptics", package: "Bow")
}
static var swiftLine: Target.Dependency {
.product(name: "Swiftline", package: "Swiftline")
}
static var swiftCheck: Target.Dependency {
.product(name: "SwiftCheck", package: "SwiftCheck")
}
static var snapshotTesting: Target.Dependency {
.product(name: "SnapshotTesting", package: "SnapshotTesting")
}
static var argumentParser: Target.Dependency {
.product(name: "ArgumentParser", package: "swift-argument-parser")
}
static var fixturesAPI: Target.Dependency {
.product(name: "FixturesAPI", package: "FixturesAPI")
}
static var fixturesAPITest: Target.Dependency {
.product(name: "FixturesAPITest", package: "FixturesAPI")
}
}
extension Target {
var asDependency: Target.Dependency {
.target(name: name)
}
}
// MARK: - Libraries
extension Target {
static var libraries: [Target] {
[
.openApiGenerator,
.cli
]
}
static var openApiGenerator: Target {
.target(name: "OpenApiGenerator",
dependencies: [.bow,
.bowEffects,
.bowOptics,
.swiftLine],
path: "OpenApiGenerator")
}
static var cli: Target {
.target(name: "CLI",
dependencies: [openApiGenerator.asDependency,
.argumentParser],
path: "BowOpenAPI")
}
}
// MARK: - Tests
extension Target {
static var tests: [Target] {
[
.generatorTests
]
}
static var generatorTests: Target {
.testTarget(name: "OpenApiGeneratorTests",
dependencies: [Target.openApiGenerator.asDependency,
.bow,
.bowEffects,
.bowOptics,
.snapshotTesting,
.swiftCheck,
.fixturesAPI,
.fixturesAPITest],
path: "Tests",
exclude: ["__Snapshots__",
"Fixtures",
"Support Files"])
}
}
// MARK: - Package
let package = Package(
name: "Bow OpenAPI",
platforms: [
.macOS(.v10_14)
],
products: [
.executable(name: "bow-openapi", targets: [Target.cli.name])
],
dependencies: [
.package(name: "Bow", url: "https://github.com/bow-swift/bow.git", .exact("0.8.0")),
.package(url: "https://github.com/apple/swift-argument-parser.git", .exact("0.2.1")),
.package(url: "https://github.com/bow-swift/Swiftline.git", .exact("0.5.6")),
.package(name: "SnapshotTesting", url: "https://github.com/pointfreeco/swift-snapshot-testing.git", .exact("1.7.2")),
.package(url: "https://github.com/bow-swift/SwiftCheck.git", .exact("0.12.1")),
.package(path: "./Tests/Fixtures/FixturesAPI"),
],
targets: [
Target.libraries,
Target.tests,
].flatMap { $0 }
)