-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
60 lines (56 loc) · 1.78 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
// swift-tools-version:5.4
import PackageDescription
#if swift(>=5.5)
let minMacOS = "12.0"
let additionalTargets = [
Target.executableTarget(
name: "ft",
dependencies: [
"APIBuilder",
"Fintoc",
.product("KeychainAccess", "KeychainAccess", .when(platforms: [.macOS])),
.product("swift-argument-parser", "ArgumentParser"),
]
),
]
let additionalProducts = [Product.executable(name: "ft", targets: ["ft"])]
let additionalDependencies: [Package.Dependency] = [
.package(url: "https://github.com/apple/swift-argument-parser", .branch("async")),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess", from: "4.2.2"),
]
#else
let minMacOS = "11.0"
let additionalTargets = [Target]()
let additionalProducts = [Product]()
let additionalDependencies = [Package.Dependency]()
#endif
let package = Package(
name: "Fintoc",
platforms: [.macOS(minMacOS)],
products: [
.library(name: "Fintoc", targets: ["Fintoc"]),
] + additionalProducts,
dependencies: [
.package(url: "https://github.com/sergiocampama/APIBuilder", .branch("main")),
] + additionalDependencies,
targets: [
.target(name: "Fintoc", dependencies: [.product("APIBuilder", "APIBuilder")]),
.testTarget(
name: "FintocTests",
dependencies: [
"Fintoc",
.product("APIBuilder", "APIBuilder"),
.product("APIBuilder", "APIBuilderTestHelpers")
]
),
] + additionalTargets
)
extension Target.Dependency {
static func product(
_ package: String,
_ name: String,
_ condition: TargetDependencyCondition? = nil
) -> Self {
.product(name: name, package: package, condition: condition)
}
}