-
Notifications
You must be signed in to change notification settings - Fork 2
/
Package.swift
104 lines (102 loc) · 3.89 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
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "swift-raft",
platforms: [.macOS("10.12")],
products: [
.library(
name: "RaftNIO",
targets: ["RaftNIO"]),
.executable(
name: "local-cluster",
targets: ["local-cluster"]),
.executable(
name: "maelstrom-node",
targets: ["maelstrom-node"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio",
.revision("72f5a563286c395e60cc12fa1aecf345b559722e")),
// Use version from main, wait for next release.
.package(url: "https://github.com/apple/swift-system", .revision("2e9c1a71185c828416751283b40697725da550b6")),
.package(url: "https://github.com/apple/swift-collections", from: "0.0.1"),
.package(url: "https://github.com/apple/swift-log", from: "1.4.0"),
.package(url: "https://github.com/grpc/grpc-swift", from: "1.0.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle", from: "1.0.0-alpha.6"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.3.2"),
.package(url: "https://github.com/Realm/SwiftLint", from: "0.43.0"),
],
targets: [
.target(
name: "local-cluster",
dependencies: [
"RaftNIO",
.product(name: "Lifecycle", package: "swift-service-lifecycle"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
exclude: ["Proto/example.proto"]),
.target(
name: "maelstrom-node",
dependencies: [
"MaelstromRaft",
.product(name: "Logging", package: "swift-log"),
.product(name: "Lifecycle", package: "swift-service-lifecycle"),
],
swiftSettings: [
.unsafeFlags([
"-Xfrontend", "-disable-availability-checking",
"-Xfrontend", "-enable-experimental-concurrency"
])
]),
.target(
name: "SwiftRaft",
dependencies: [
.product(name: "SystemPackage", package: "swift-system"),
.product(name: "Logging", package: "swift-log"),
.product(name: "DequeModule", package: "swift-collections"),
],
swiftSettings: [
.unsafeFlags(["-Xfrontend", "-enable-experimental-concurrency"])
]),
.target(
name: "RaftNIO",
dependencies: [
"SwiftRaft",
.product(name: "_NIOConcurrency", package: "swift-nio"),
.product(name: "SystemPackage", package: "swift-system"),
.product(name: "GRPC", package: "grpc-swift"),
.product(name: "Logging", package: "swift-log"),
],
exclude: ["Proto/raft.proto"],
swiftSettings: [
.unsafeFlags(["-Xfrontend", "-enable-experimental-concurrency"])
]),
.target(
name: "MaelstromRaft",
dependencies: [
"SwiftRaft",
"RaftNIO",
.product(name: "Logging", package: "swift-log"),
],
swiftSettings: [
.unsafeFlags(["-Xfrontend", "-enable-experimental-concurrency"])
]),
/// Test tragets
.testTarget(
name: "SwiftRaftTests",
dependencies: [
"SwiftRaft"
]),
.testTarget(
name: "RaftNIOTests",
dependencies: [
"RaftNIO"
]),
.testTarget(
name: "MaelstromRaftTests",
dependencies: [
"MaelstromRaft"
]),
]
)