-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
94 lines (89 loc) · 3.25 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
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import Foundation
import PackageDescription
let package = Package(
name: "cli-kit",
platforms: [.macOS(.v14)],
products: [
.library(
name: "CLIKit",
targets: ["CLIKit"]
),
.library(
name: "CLITestKit",
targets: ["CLITestKit"]
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-testing.git", from: "0.10.0"),
.package(url: "https://github.com/realm/SwiftLint.git", branch: "main"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin.git", from: "1.0.0"),
.package(url: "https://github.com/vapor/console-kit.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/fluent.git", from: "4.0.0"),
.package(url: "https://github.com/vapor/fluent-sqlite-driver.git", from: "4.0.0"),
.package(url: "https://github.com/Zollerboy1/SwiftCommand.git", from: "1.4.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-dependencies.git", from: "1.0.0"),
],
targets: [
.target(
name: "CLIKit",
dependencies: [
.product(name: "ConsoleKit", package: "console-kit"),
.product(name: "Fluent", package: "fluent"),
.product(name: "FluentSQLiteDriver", package: "fluent-sqlite-driver"),
.product(name: "SwiftCommand", package: "SwiftCommand"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "Dependencies", package: "swift-dependencies"),
],
swiftSettings: swiftSettings,
plugins: swiftLintPlugins
),
.testTarget(
name: "CLIKitTests",
dependencies: [
"CLIKit",
.product(name: "Testing", package: "swift-testing"),
.target(name: "CLITestKit"),
],
swiftSettings: swiftSettings,
plugins: swiftLintPlugins
),
.target(
name: "CLITestKit",
dependencies: [
.target(name: "CLIKit"),
],
swiftSettings: swiftSettings,
plugins: swiftLintPlugins
),
.testTarget(
name: "CLITestKitTests",
dependencies: [
"CLITestKit",
.product(name: "Testing", package: "swift-testing"),
],
swiftSettings: swiftSettings,
plugins: swiftLintPlugins
),
]
)
var swiftSettings: [SwiftSetting] { [
.enableUpcomingFeature("DisableOutwardActorInference"),
.enableExperimentalFeature("StrictConcurrency"),
] }
var swiftLintPlugins: [Target.PluginUsage] {
guard Environment.enableSwiftLint else { return [] }
return [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")
]
}
enum Environment {
static func get(_ key: String) -> String? {
ProcessInfo.processInfo.environment[key]
}
static var enableSwiftLint: Bool {
Self.get("SWIFTLINT") == "true"
}
}