Skip to content

Commit 3e71f43

Browse files
Add Swift 5.9 package manifest (#343)
1 parent 8716114 commit 3e71f43

File tree

2 files changed

+84
-46
lines changed

2 files changed

+84
-46
lines changed

Package.swift

+2-46
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22

33
import PackageDescription
44

5-
let packageName = "Layout"
6-
7-
enum SwiftLint {
8-
static let plugin = "SwiftLintPlugin-\(packageName)"
9-
static let binary = "SwiftLintBinary-\(packageName)"
10-
}
11-
125
let package = Package(
13-
name: packageName,
6+
name: "Layout",
147
platforms: [
158
.iOS(.v13),
169
],
@@ -29,11 +22,7 @@ let package = Package(
2922
],
3023
targets: [
3124
.target(
32-
name: "Layout",
33-
swiftSettings: .swiftSettings,
34-
plugins: [
35-
.plugin(name: SwiftLint.plugin),
36-
]),
25+
name: "Layout"),
3726
.testTarget(
3827
name: "LayoutTests",
3928
dependencies: [
@@ -44,39 +33,6 @@ let package = Package(
4433
exclude: [
4534
"__Snapshots__",
4635
"UIKit/__Snapshots__",
47-
],
48-
swiftSettings: .swiftSettings,
49-
plugins: [
50-
.plugin(name: SwiftLint.plugin),
5136
]),
52-
.plugin(
53-
name: "SwiftLintCommand",
54-
capability: .command(intent: .custom(verb: "swiftlint", description: "SwiftLint Command Plugin")),
55-
dependencies: [
56-
.target(name: SwiftLint.binary)
57-
]),
58-
.plugin(
59-
name: SwiftLint.plugin,
60-
capability: .buildTool(),
61-
dependencies: [
62-
.target(name: SwiftLint.binary)
63-
],
64-
path: "Plugins/SwiftLintPlugin"),
65-
.binaryTarget(
66-
name: SwiftLint.binary,
67-
url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip",
68-
checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"),
6937
]
7038
)
71-
72-
extension Array where Element == SwiftSetting {
73-
74-
static var swiftSettings: [SwiftSetting] {
75-
if let value: String = Context.environment["SWIFT_STRICT_CONCURRENCY"] {
76-
return [.unsafeFlags(["-strict-concurrency=\(value)"])]
77-
} else if Context.environment["SWIFT_EMIT_EXTENSION_BLOCK_SYMBOLS"] != nil {
78-
return [.unsafeFlags(["-emit-extension-block-symbols"])]
79-
}
80-
return []
81-
}
82-
}

[email protected]

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// swift-tools-version:5.9
2+
3+
import PackageDescription
4+
5+
let packageName = "Layout"
6+
7+
enum SwiftLint {
8+
static let plugin = "SwiftLintPlugin-\(packageName)"
9+
static let binary = "SwiftLintBinary-\(packageName)"
10+
}
11+
12+
let package = Package(
13+
name: packageName,
14+
platforms: [
15+
.iOS(.v13),
16+
],
17+
products: [
18+
.library(
19+
name: "Layout",
20+
targets: ["Layout"]),
21+
],
22+
dependencies: [
23+
.package(
24+
url: "https://github.com/Quick/Nimble.git",
25+
from: "13.0.0"),
26+
.package(
27+
url: "https://github.com/pointfreeco/swift-snapshot-testing.git",
28+
from: "1.15.0"),
29+
],
30+
targets: [
31+
.target(
32+
name: "Layout",
33+
swiftSettings: .swiftSettings,
34+
plugins: [
35+
.plugin(name: SwiftLint.plugin),
36+
]),
37+
.testTarget(
38+
name: "LayoutTests",
39+
dependencies: [
40+
"Layout",
41+
"Nimble",
42+
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
43+
],
44+
exclude: [
45+
"__Snapshots__",
46+
"UIKit/__Snapshots__",
47+
],
48+
swiftSettings: .swiftSettings,
49+
plugins: [
50+
.plugin(name: SwiftLint.plugin),
51+
]),
52+
.plugin(
53+
name: "SwiftLintCommand",
54+
capability: .command(intent: .custom(verb: "swiftlint", description: "SwiftLint Command Plugin")),
55+
dependencies: [
56+
.target(name: SwiftLint.binary)
57+
]),
58+
.plugin(
59+
name: SwiftLint.plugin,
60+
capability: .buildTool(),
61+
dependencies: [
62+
.target(name: SwiftLint.binary)
63+
],
64+
path: "Plugins/SwiftLintPlugin"),
65+
.binaryTarget(
66+
name: SwiftLint.binary,
67+
url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip",
68+
checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"),
69+
]
70+
)
71+
72+
extension Array where Element == SwiftSetting {
73+
74+
static var swiftSettings: [SwiftSetting] {
75+
if let value: String = Context.environment["SWIFT_STRICT_CONCURRENCY"] {
76+
return [.unsafeFlags(["-strict-concurrency=\(value)"])]
77+
} else if Context.environment["SWIFT_EMIT_EXTENSION_BLOCK_SYMBOLS"] != nil {
78+
return [.unsafeFlags(["-emit-extension-block-symbols"])]
79+
}
80+
return []
81+
}
82+
}

0 commit comments

Comments
 (0)