Skip to content

Commit 874b691

Browse files
author
Rob Amos
committed
Cleanup
1 parent 2a51cd8 commit 874b691

File tree

2 files changed

+18
-68
lines changed

2 files changed

+18
-68
lines changed

Package.swift

Lines changed: 18 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,33 @@ let package = Package(
2020
// .library(name: "Vexillographer", targets: [ "Vexillographer" ]),
2121
],
2222

23-
dependencies: .init {
24-
Package.Dependency.package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0")
25-
Package.Dependency.package(url: "https://github.com/nicklockwood/SwiftFormat.git", from: "0.54.1")
26-
Package.Dependency.package(url: "https://github.com/swiftlang/swift-syntax.git", .upToNextMajor(from: "600.0.1"))
27-
},
23+
dependencies: [
24+
.package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0"),
25+
.package(url: "https://github.com/nicklockwood/SwiftFormat.git", from: "0.54.1"),
26+
.package(url: "https://github.com/swiftlang/swift-syntax.git", "600.0.0"..<"603.0.0"),
27+
],
2828

29-
targets: .init {
29+
targets: [
3030

3131
// Vexil
3232

33-
Target.target(
33+
.target(
3434
name: "Vexil",
3535
dependencies: [
3636
.target(name: "VexilMacros"),
3737
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
38-
],
39-
swiftSettings: [
40-
.swiftLanguageMode(.v6),
4138
]
42-
)
43-
Target.testTarget(
39+
),
40+
.testTarget(
4441
name: "VexilTests",
45-
dependencies: .init {
46-
Target.Dependency.target(name: "Vexil")
47-
},
48-
swiftSettings: [
49-
.swiftLanguageMode(.v6),
42+
dependencies: [
43+
.target(name: "Vexil")
5044
]
51-
)
45+
),
5246

5347
// Vexillographer
5448

55-
// Target.target(
49+
// .target(
5650
// name: "Vexillographer",
5751
// dependencies: [
5852
// .target(name: "Vexil"),
@@ -61,66 +55,29 @@ let package = Package(
6155

6256
// Macros
6357

64-
Target.macro(
58+
.macro(
6559
name: "VexilMacros",
6660
dependencies: [
6761
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
6862
.product(name: "SwiftSyntax", package: "swift-syntax"),
6963
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
7064
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
71-
],
72-
swiftSettings: [
73-
.swiftLanguageMode(.v6),
7465
]
75-
)
76-
77-
#if !os(Linux)
66+
),
7867

7968
// We can't disable macro validation using `swift test` so these are guaranteed to fail on Linux
80-
Target.testTarget(
69+
.testTarget(
8170
name: "VexilMacroTests",
8271
dependencies: [
8372
.target(name: "VexilMacros"),
8473
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
85-
],
86-
swiftSettings: [
87-
.swiftLanguageMode(.v6),
8874
]
89-
)
90-
91-
#endif
75+
),
9276

93-
},
77+
],
9478

9579
swiftLanguageModes: [
9680
.v6,
9781
]
9882

9983
)
100-
101-
// MARK: - Helpers
102-
103-
@resultBuilder
104-
enum CollectionBuilder<Element> {
105-
106-
typealias Component = [Element]
107-
108-
static func buildExpression(_ expression: Element) -> Component {
109-
[expression]
110-
}
111-
112-
static func buildBlock(_ components: Component...) -> Component {
113-
components.flatMap { $0 }
114-
}
115-
116-
static func buildLimitedAvailability(_ components: [Element]) -> Component {
117-
components
118-
}
119-
120-
}
121-
122-
extension Array {
123-
init(@CollectionBuilder<Element> collecting: () -> [Element]) {
124-
self = collecting()
125-
}
126-
}

Sources/VexilMacros/Plugin.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
//
15-
// Plugin.swift
16-
// Vexil: VexilMacros
17-
//
18-
// Created by Rob Amos on 11/6/2023.
19-
//
20-
2114
import SwiftCompilerPlugin
2215
import SwiftSyntaxMacros
2316

0 commit comments

Comments
 (0)