|
1 | | -// swift-tools-version:5.2 |
| 1 | +// swift-tools-version:5.3 |
2 | 2 | import PackageDescription |
3 | 3 |
|
| 4 | +#if compiler(>=5.6) |
| 5 | +let swiftSyntaxVersion: Package.Dependency.Requirement = .exact("0.50600.1-static") |
| 6 | +#elseif compiler(>=5.5) |
| 7 | +let swiftSyntaxVersion: Package.Dependency.Requirement = .exact("0.50500.0-static") |
| 8 | +#elseif compiler(>=5.4) |
| 9 | +let swiftSyntaxVersion: Package.Dependency.Requirement = .exact("0.50400.0") |
| 10 | +#elseif compiler(>=5.3) |
| 11 | +let swiftSyntaxVersion: Package.Dependency.Requirement = .exact("0.50300.0") |
| 12 | +#else |
| 13 | +fatalError("This version of Periphery does not support Swift <= 5.2.") |
| 14 | +#endif |
| 15 | + |
4 | 16 | var dependencies: [Package.Dependency] = [ |
5 | 17 | .package(url: "https://github.com/apple/swift-system", from: "1.0.0"), |
6 | 18 | .package(url: "https://github.com/jpsim/Yams", from: "4.0.0"), |
7 | 19 | .package(url: "https://github.com/tadija/AEXML", from: "4.0.0"), |
8 | 20 | .package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"), |
9 | | - .package(name: "SwiftIndexStore", url: "https://github.com/kateinoigakukun/swift-indexstore", from: "0.0.0") |
| 21 | + .package(name: "SwiftIndexStore", url: "https://github.com/kateinoigakukun/swift-indexstore", from: "0.0.0"), |
| 22 | + .package(name: "SwiftSyntax", url: "https://github.com/peripheryapp/swift-syntax", swiftSyntaxVersion) |
10 | 23 | ] |
11 | | -#if swift(>=5.6) |
12 | | -dependencies.append( |
13 | | - .package( |
14 | | - name: "SwiftSyntax", |
15 | | - url: "https://github.com/apple/swift-syntax", |
16 | | - .exact("0.50600.1") |
17 | | - ) |
18 | | -) |
19 | | -#elseif swift(>=5.5) |
20 | | -dependencies.append( |
21 | | - .package( |
22 | | - name: "SwiftSyntax", |
23 | | - url: "https://github.com/apple/swift-syntax", |
24 | | - .exact("0.50500.0") |
25 | | - ) |
26 | | -) |
27 | | -#elseif swift(>=5.4) |
28 | | -dependencies.append( |
29 | | - .package( |
30 | | - name: "SwiftSyntax", |
31 | | - url: "https://github.com/apple/swift-syntax", |
32 | | - .exact("0.50400.0") |
33 | | - ) |
34 | | -) |
35 | | -#elseif swift(>=5.3) |
36 | | -dependencies.append( |
37 | | - .package( |
38 | | - name: "SwiftSyntax", |
39 | | - url: "https://github.com/apple/swift-syntax", |
40 | | - .exact("0.50300.0") |
41 | | - ) |
42 | | -) |
43 | | -#else |
44 | | -fatalError("This version of Periphery does not support Swift <= 5.2.") |
45 | | -#endif |
46 | 24 |
|
47 | 25 | #if os(macOS) |
48 | 26 | dependencies.append( |
@@ -72,13 +50,8 @@ var peripheryKitDependencies: [PackageDescription.Target.Dependency] = [ |
72 | 50 | .product(name: "SwiftIndexStore", package: "SwiftIndexStore") |
73 | 51 | ] |
74 | 52 |
|
75 | | -#if swift(>=5.6) |
76 | | -peripheryKitDependencies.append( |
77 | | - .product( |
78 | | - name: "SwiftSyntaxParser", |
79 | | - package: "SwiftSyntax" |
80 | | - ) |
81 | | -) |
| 53 | +#if compiler(>=5.6) |
| 54 | +peripheryKitDependencies.append(.product(name: "SwiftSyntaxParser", package: "SwiftSyntax")) |
82 | 55 | #endif |
83 | 56 |
|
84 | 57 | var targets: [PackageDescription.Target] = [ |
|
0 commit comments