-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathPackage.swift
109 lines (103 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
105
106
107
108
109
// swift-tools-version:5.2
// swiftlint:disable explicit_top_level_acl
// swiftlint:disable prefixed_toplevel_constant
// swiftlint:disable line_length
// swiftlint:disable explicit_acl
import PackageDescription
let package = Package(
name: "MistKit",
platforms: [.macOS(.v10_15)],
products: [
.library(
name: "MistKit",
targets: ["MistKit"]
),
.library(
name: "MistKitNIO",
targets: ["MistKitNIO"]
),
.library(
name: "MistKitVapor",
targets: ["MistKitVapor"]
),
.executable(name: "mistdemoc", targets: ["mistdemoc"]),
.executable(name: "mistdemod", targets: ["mistdemod"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.20.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.3.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/swift-server/async-http-client.git", from: "1.6.0"),
// dev
.package(url: "https://github.com/shibapm/Komondor", from: "1.1.1"), // dev
.package(url: "https://github.com/eneko/SourceDocs", from: "1.2.1"), // dev
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.48.12"), // dev
.package(url: "https://github.com/realm/SwiftLint", from: "0.43.0"), // dev
.package(url: "https://github.com/shibapm/Rocket", from: "1.2.0"), // dev
.package(url: "https://github.com/brightdigit/swift-test-codecov", from: "1.0.0") // dev
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "MistKit",
dependencies: []
),
.target(name: "MistKitNIO",
dependencies: [
"MistKit",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "AsyncHTTPClient", package: "async-http-client")
]),
.target(name: "MistKitVapor",
dependencies: [
"MistKit",
"MistKitNIO",
.product(name: "Vapor", package: "vapor"),
.product(name: "Fluent", package: "fluent")
]),
.target(name: "mistdemoc", dependencies: [
"MistKit",
"MistKitNIO", "MistKitDemo",
.product(name: "ArgumentParser", package: "swift-argument-parser")
]),
.target(name: "mistdemod", dependencies: [
"MistKit", "MistKitVapor", "MistKitDemo",
.product(name: "Vapor", package: "vapor"),
.product(name: "Fluent", package: "fluent"),
.product(name: "FluentSQLiteDriver", package: "fluent-sqlite-driver")
]),
.target(name: "MistKitDemo",
dependencies: ["MistKit"]),
.testTarget(
name: "MistKitTests",
dependencies: ["MistKit"]
)
]
)
#if canImport(PackageConfig)
import PackageConfig
let requiredCoverage: Int = 40
let config = PackageConfiguration([
"komondor": [
"pre-push": [
"swift test --enable-code-coverage --enable-test-discovery",
"swift run swift-test-codecov .build/debug/codecov/MistKit.json --minimum \(requiredCoverage)"
],
"pre-commit": [
"swift test --enable-code-coverage --enable-test-discovery --generate-linuxmain",
"swift run swiftformat .",
"swift run swiftlint autocorrect",
// "swift run sourcedocs generate build -cra",
"git add .",
"swift run swiftformat --lint .",
"swift run swiftlint"
]
]
]).write()
#endif