-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
61 lines (54 loc) · 2.34 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
// swift-tools-version: 5.4
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
extension Target.Dependency {
static func paris(_ name: String) -> Target.Dependency {
.product(name: name, package: "Paris")
}
static func barcelona(_ name: String) -> Target.Dependency {
.product(name: name, package: "Barcelona")
}
}
extension Package {
func addingLibrary(name: String, dependencies: [Target.Dependency] = []) -> Package {
products.append(.library(name: name, targets: [name]))
targets.append(.target(name: name, dependencies: dependencies))
return self
}
}
extension Array {
static func paris(_ names: String...) -> [Target.Dependency] {
names.map { .paris($0) }
}
static func barcelona(_ names: String...) -> [Target.Dependency] {
names.map { .barcelona($0) }
}
}
let package = Package(
name: "barcelona-mautrix",
platforms: [
.iOS(.v13), .macOS(.v10_15)
],
products: [
.executable(name: "barcelona-mautrix", targets: ["barcelona-mautrix"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "Barcelona", url: "https://github.com/open-imcore/barcelona", .upToNextMajor(from: "1.0.3")),
// .package(name: "Barcelona", path: "../../barcelona"),
.package(url: "https://github.com/SwiftyContacts/SwiftyContacts", .upToNextMajor(from: "4.0.0")),
.package(url: "https://github.com/EricRabil/ERBufferedStream", .upToNextMajor(from: "1.0.4")),
.package(name: "SwiftProtobuf", url: "https://github.com/apple/swift-protobuf", from: "1.20.0"),
.package(name: "GRPC", url: "https://github.com/grpc/grpc-swift.git", from: "1.9.0"),
.package(url: "https://github.com/EricRabil/Yammit", .upToNextMajor(from: "1.0.2"))
],
targets: [
.executableTarget(name: "barcelona-mautrix", dependencies: [
"BarcelonaMautrixIPC"
], resources: [.copy("barcelona-mautrix.entitlements")])
]
)
.addingLibrary(name: "BarcelonaMautrixIPC", dependencies: [
.barcelona("Barcelona"), .barcelona("BarcelonaDB"), .barcelona("BarcelonaJS"), "SwiftyContacts", "ERBufferedStream", "Yammit"
])