1
- // swift-tools-version:5.1
1
+ // swift-tools-version:5.6
2
2
//===----------------------------------------------------------------------===//
3
3
//
4
4
// This source file is part of the Swift.org open source project
11
11
//
12
12
//===----------------------------------------------------------------------===//
13
13
14
- import PackageDescription
15
14
import Foundation
15
+ import PackageDescription
16
16
17
17
let package = Package (
18
18
name: " swift-format " ,
19
19
platforms: [
20
- . macOS( . v10_11 )
20
+ . macOS( " 10.15 " )
21
21
] ,
22
22
products: [
23
- . executable( name: " swift-format " , targets: [ " swift-format " ] ) ,
24
- . library( name: " SwiftFormat " , targets: [ " SwiftFormat " , " SwiftFormatConfiguration " ] ) ,
25
- . library( name: " SwiftFormatConfiguration " , targets: [ " SwiftFormatConfiguration " ] ) ,
23
+ . executable(
24
+ name: " swift-format " ,
25
+ targets: [ " swift-format " ]
26
+ ) ,
27
+ . library(
28
+ name: " SwiftFormat " ,
29
+ targets: [ " SwiftFormat " , " SwiftFormatConfiguration " ]
30
+ ) ,
31
+ . library(
32
+ name: " SwiftFormatConfiguration " ,
33
+ targets: [ " SwiftFormatConfiguration " ]
34
+ ) ,
26
35
] ,
27
36
dependencies: [
37
+ // See the "Dependencies" section below.
28
38
] ,
29
39
targets: [
30
40
. target(
@@ -35,12 +45,20 @@ let package = Package(
35
45
" SwiftFormatPrettyPrint " ,
36
46
" SwiftFormatRules " ,
37
47
" SwiftFormatWhitespaceLinter " ,
38
- " SwiftSyntax " ,
39
- " SwiftSyntaxParser " ,
48
+ . product( name: " SwiftSyntax " , package : " swift-syntax " ) ,
49
+ . product( name: " SwiftSyntaxParser " , package : " swift-syntax " ) ,
50
+ ]
51
+ ) ,
52
+ . target(
53
+ name: " SwiftFormatConfiguration "
54
+ ) ,
55
+ . target(
56
+ name: " SwiftFormatCore " ,
57
+ dependencies: [
58
+ " SwiftFormatConfiguration " ,
59
+ . product( name: " SwiftSyntax " , package : " swift-syntax " ) ,
40
60
]
41
61
) ,
42
- . target( name: " SwiftFormatConfiguration " ) ,
43
- . target( name: " SwiftFormatCore " , dependencies: [ " SwiftFormatConfiguration " , " SwiftSyntax " ] ) ,
44
62
. target(
45
63
name: " SwiftFormatRules " ,
46
64
dependencies: [ " SwiftFormatCore " , " SwiftFormatConfiguration " ]
@@ -61,35 +79,37 @@ let package = Package(
61
79
name: " SwiftFormatWhitespaceLinter " ,
62
80
dependencies: [
63
81
" SwiftFormatCore " ,
64
- " SwiftSyntax " ,
82
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
65
83
]
66
84
) ,
67
- . target(
85
+
86
+ . executableTarget(
68
87
name: " generate-pipeline " ,
69
88
dependencies: [
70
89
" SwiftFormatCore " ,
71
90
" SwiftFormatRules " ,
72
- " SwiftSyntax " ,
73
- " SwiftSyntaxParser " ,
91
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
92
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
74
93
]
75
94
) ,
76
- . target (
95
+ . executableTarget (
77
96
name: " swift-format " ,
78
97
dependencies: [
79
- " ArgumentParser " ,
80
98
" SwiftFormat " ,
81
99
" SwiftFormatConfiguration " ,
82
100
" SwiftFormatCore " ,
83
- " SwiftSyntax " ,
84
- " TSCBasic " ,
101
+ . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
102
+ . product( name: " SwiftSyntax " , package : " swift-syntax " ) ,
103
+ . product( name: " TSCBasic " , package : " swift-tools-support-core " ) ,
85
104
]
86
105
) ,
106
+
87
107
. testTarget(
88
108
name: " SwiftFormatTests " ,
89
109
dependencies: [
90
110
" SwiftFormat " ,
91
- " SwiftSyntax " ,
92
- " SwiftSyntaxParser " ,
111
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
112
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
93
113
]
94
114
) ,
95
115
. testTarget(
@@ -101,17 +121,17 @@ let package = Package(
101
121
dependencies: [
102
122
" SwiftFormatConfiguration " ,
103
123
" SwiftFormatCore " ,
104
- " SwiftSyntax " ,
105
- " SwiftSyntaxParser " ,
124
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
125
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
106
126
]
107
127
) ,
108
128
. testTarget(
109
129
name: " SwiftFormatPerformanceTests " ,
110
130
dependencies: [
111
131
" SwiftFormatTestSupport " ,
112
132
" SwiftFormatWhitespaceLinter " ,
113
- " SwiftSyntax " ,
114
- " SwiftSyntaxParser " ,
133
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
134
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
115
135
]
116
136
) ,
117
137
. testTarget(
@@ -122,8 +142,8 @@ let package = Package(
122
142
" SwiftFormatPrettyPrint " ,
123
143
" SwiftFormatRules " ,
124
144
" SwiftFormatTestSupport " ,
125
- " SwiftSyntax " ,
126
- " SwiftSyntaxParser " ,
145
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
146
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
127
147
]
128
148
) ,
129
149
. testTarget(
@@ -134,8 +154,8 @@ let package = Package(
134
154
" SwiftFormatPrettyPrint " ,
135
155
" SwiftFormatRules " ,
136
156
" SwiftFormatTestSupport " ,
137
- " SwiftSyntax " ,
138
- " SwiftSyntaxParser " ,
157
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
158
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
139
159
]
140
160
) ,
141
161
. testTarget(
@@ -145,20 +165,30 @@ let package = Package(
145
165
" SwiftFormatCore " ,
146
166
" SwiftFormatTestSupport " ,
147
167
" SwiftFormatWhitespaceLinter " ,
148
- " SwiftSyntax " ,
149
- " SwiftSyntaxParser " ,
168
+ . product ( name : " SwiftSyntax " , package : " swift-syntax " ) ,
169
+ . product ( name : " SwiftSyntaxParser " , package : " swift-syntax " ) ,
150
170
]
151
171
) ,
152
172
]
153
173
)
154
174
175
+ // MARK: Dependencies
155
176
156
177
if ProcessInfo . processInfo. environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
157
178
// Building standalone.
158
179
package . dependencies += [
159
- . package ( url: " https://github.com/apple/swift-argument-parser.git " , . branch( " main " ) ) ,
160
- . package ( url: " https://github.com/apple/swift-syntax " , . branch( " main " ) ) ,
161
- . package ( url: " https://github.com/apple/swift-tools-support-core.git " , . branch( " main " ) ) ,
180
+ . package (
181
+ url: " https://github.com/apple/swift-argument-parser.git " ,
182
+ branch: " main "
183
+ ) ,
184
+ . package (
185
+ url: " https://github.com/apple/swift-syntax " ,
186
+ branch: " main "
187
+ ) ,
188
+ . package (
189
+ url: " https://github.com/apple/swift-tools-support-core.git " ,
190
+ branch: " main "
191
+ ) ,
162
192
]
163
193
} else {
164
194
package . dependencies += [
0 commit comments