-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (89 loc) · 2.95 KB
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
// swift-tools-version:5.9
import PackageDescription
let packageName = "Layout"
enum SwiftLint {
static let plugin = "SwiftLintPlugin-\(packageName)"
static let binary = "SwiftLintBinary-\(packageName)"
}
let package = Package(
name: packageName,
platforms: [
.iOS(.v13),
],
products: [
.library(
name: "Layout",
targets: ["Layout"]),
.library(
name: "SnapshotTestingExtensions",
targets: ["SnapshotTestingExtensions"]),
],
dependencies: [
.package(
url: "https://github.com/Quick/Nimble.git",
from: "13.0.0"),
.package(
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
from: "1.15.0"),
],
targets: [
.target(
name: "Layout",
swiftSettings: .swiftSettings,
plugins: [
.plugin(name: SwiftLint.plugin),
]),
.target(
name: "SnapshotTestingExtensions",
dependencies: [
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
swiftSettings: .swiftSettings,
plugins: [
.plugin(name: SwiftLint.plugin),
]),
.testTarget(
name: "LayoutTests",
dependencies: [
"Layout",
"SnapshotTestingExtensions",
"Nimble",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
],
exclude: [
"__Snapshots__",
"UIKitTests/__Snapshots__",
],
swiftSettings: .swiftSettings,
plugins: [
.plugin(name: SwiftLint.plugin),
]),
.plugin(
name: "SwiftLintCommand",
capability: .command(intent: .custom(verb: "swiftlint", description: "SwiftLint Command Plugin")),
dependencies: [
.target(name: SwiftLint.binary)
]),
.plugin(
name: SwiftLint.plugin,
capability: .buildTool(),
dependencies: [
.target(name: SwiftLint.binary)
],
path: "Plugins/SwiftLintPlugin"),
.binaryTarget(
name: SwiftLint.binary,
url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip",
checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"),
]
)
extension Array where Element == SwiftSetting {
static var swiftSettings: [SwiftSetting] {
if let value: String = Context.environment["SWIFT_STRICT_CONCURRENCY"] {
return [.unsafeFlags(["-strict-concurrency=\(value)"])]
} else if Context.environment["SWIFT_EMIT_EXTENSION_BLOCK_SYMBOLS"] != nil {
return [.unsafeFlags(["-emit-extension-block-symbols"])]
}
return []
}
}