-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPackage.swift
73 lines (57 loc) · 1.94 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
// swift-tools-version:5.0
import PackageDescription
//===---
// Single Source Libraries
//
var testCases = [String]()
testCases.append("CombineIdentifierCreation")
testCases.append("DeepMap")
testCases.append("PassthroughSubject_SendValue")
testCases.append("SequenceDelivery")
//===---
// Products
//
var products: [Product] = []
products.append(.library(name: "TestsUtils", type: .static, targets: ["TestsUtils"]))
products.append(.library(name: "DriverUtils", type: .static, targets: ["DriverUtils"]))
products.append(.executable(name: "Benchmark_O", targets: ["OpenCombineBench"]))
products += testCases.map { .library(name: $0, type: .static, targets: [$0]) }
//===---
// Targets
//
var targets: [Target] = []
targets.append(.target(name: "TestsUtils", path: "utils", sources: ["TestsUtils.swift"]))
targets.append(.systemLibrary(name: "LibProc", path: "utils/LibProc"))
targets.append(
.target(name: "DriverUtils",
dependencies: [.target(name: "TestsUtils"), "LibProc"],
path: "utils",
sources: ["DriverUtils.swift", "ArgParse.swift"]))
var swiftBenchDeps: [Target.Dependency] = [.target(name: "TestsUtils")]
swiftBenchDeps.append(.target(name: "DriverUtils"))
swiftBenchDeps += testCases.map { .target(name: $0) }
targets.append(
.target(name: "OpenCombineBench",
dependencies: swiftBenchDeps,
path: "utils",
sources: ["main.swift"])
)
targets += testCases.map { name in
.target(name: name,
dependencies: ["OpenCombine", "CombineX", "TestsUtils"],
path: "test-cases",
sources: ["GENERATED-\(name).swift"])
}
//===---
// Top Level Definition
//
let p = Package.init(
name: "OpenCombineBenchmark",
platforms: [.macOS("10.15"), .iOS("13.0")],
products: products,
dependencies: [
.package(path: "../OpenCombine"),
.package(url: "https://github.com/cx-org/CombineX.git", .branch("master"))
],
targets: targets
)