-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
81 lines (71 loc) · 2.87 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
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "DiscordLogger",
platforms: [
.macOS(.v13),
.iOS(.v16),
.tvOS(.v16),
.watchOS(.v9),
],
products: [
.library(
name: "DiscordLogger",
targets: ["DiscordLogger"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.49.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.2"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.21.0"),
.package(url: "https://github.com/DiscordBM/DiscordBM.git", from: "1.0.0-rc.1"),
],
targets: [
.target(
name: "DiscordLogger",
dependencies: [
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "Logging", package: "swift-log"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "DiscordHTTP", package: "DiscordBM"),
.product(name: "DiscordUtilities", package: "DiscordBM"),
],
swiftSettings: swiftSettings
),
.testTarget(
name: "DiscordLoggerTests",
dependencies: ["DiscordLogger"],
swiftSettings: swiftSettings
),
]
)
var featureFlags: [SwiftSetting] {
[
/// `-enable-upcoming-feature` flags will get removed in the future
/// and we'll need to remove them from here too.
/// https://github.com/apple/swift-evolution/blob/main/proposals/0335-existential-any.md
/// Require `any` for existential types.
.enableUpcomingFeature("ExistentialAny"),
/// https://github.com/apple/swift-evolution/blob/main/proposals/0274-magic-file.md
/// Nicer `#file`.
.enableUpcomingFeature("ConciseMagicFile"),
/// https://github.com/apple/swift-evolution/blob/main/proposals/0286-forward-scan-trailing-closures.md
/// This one shouldn't do much to be honest, but shouldn't hurt as well.
.enableUpcomingFeature("ForwardTrailingClosures"),
/// https://github.com/apple/swift-evolution/blob/main/proposals/0354-regex-literals.md
/// `BareSlashRegexLiterals` not enabled since we don't use regex anywhere.
/// https://github.com/apple/swift-evolution/blob/main/proposals/0384-importing-forward-declared-objc-interfaces-and-protocols.md
/// `ImportObjcForwardDeclarations` not enabled because it's objc-related.
]
}
var experimentalFeatureFlags: [SwiftSetting] {
[
/// `DiscordBM` passes the `complete` level.
///
/// `minimal` / `targeted` / `complete`
.enableExperimentalFeature("StrictConcurrency=complete"),
]
}
var swiftSettings: [SwiftSetting] {
featureFlags + experimentalFeatureFlags
}