@@ -68,7 +68,7 @@ def get_arguments() -> argparse.Namespace:
68
68
dest = "config" ,
69
69
default = Configuration .DEBUG ,
70
70
choices = [e for e in Configuration ],
71
- help = "The configuraiton to use." ,
71
+ help = "The configuration to use." ,
72
72
)
73
73
parser .add_argument (
74
74
"-t" ,
@@ -90,6 +90,36 @@ def get_arguments() -> argparse.Namespace:
90
90
"--enable-xctest" ,
91
91
action = "store_true" ,
92
92
)
93
+ parser .add_argument (
94
+ "--additional-build-args" ,
95
+ type = str ,
96
+ dest = "additional_build_args" ,
97
+ default = ""
98
+ )
99
+ parser .add_argument (
100
+ "--additional-run-args" ,
101
+ type = str ,
102
+ dest = "additional_run_args" ,
103
+ default = ""
104
+ )
105
+ parser .add_argument (
106
+ "--additional-test-args" ,
107
+ type = str ,
108
+ dest = "additional_test_args" ,
109
+ default = ""
110
+ )
111
+ parser .add_argument (
112
+ "--additional-integration-test-args" ,
113
+ type = str ,
114
+ dest = "additional_integration_test_args" ,
115
+ default = ""
116
+ )
117
+ parser .add_argument (
118
+ "--skip-bootstrap" ,
119
+ dest = "skip_bootstrap" ,
120
+ action = "store_true"
121
+ )
122
+ parser .set_defaults (skip_bootstrap = False )
93
123
args = parser .parse_args ()
94
124
return args
95
125
@@ -157,8 +187,8 @@ class GlobalArgs:
157
187
value : t .Optional [GlobalArgsValueType ]
158
188
159
189
160
- def filterNone (items : t .Iterable ) -> t .Iterable :
161
- return list (filter (lambda x : x is not None , items ))
190
+ def filterNoneAndEmpty (items : t .Iterable ) -> t .Iterable :
191
+ return list (filter (lambda x : x is not None and x != '' , items ))
162
192
163
193
164
194
def main () -> None :
@@ -181,7 +211,7 @@ def main() -> None:
181
211
set_environment (swiftpm_bin_dir = swiftpm_bin_dir )
182
212
183
213
call (
184
- filterNone (
214
+ filterNoneAndEmpty (
185
215
[
186
216
"swift" ,
187
217
"--version" ,
@@ -190,7 +220,7 @@ def main() -> None:
190
220
)
191
221
192
222
call (
193
- filterNone (
223
+ filterNoneAndEmpty (
194
224
[
195
225
"swift" ,
196
226
"package" ,
@@ -199,44 +229,42 @@ def main() -> None:
199
229
)
200
230
)
201
231
call (
202
- filterNone (
232
+ filterNoneAndEmpty (
203
233
[
204
234
"swift" ,
205
235
"build" ,
206
236
* global_args ,
207
237
"--configuration" ,
208
238
args .config ,
209
239
* ignore_args ,
240
+ * args .additional_build_args .split (" " )
210
241
]
211
242
)
212
243
)
213
-
214
- swift_testing_arg = (
215
- "--enable-swift-testing" if args .enable_swift_testing else None
216
- )
217
- xctest_arg = "--enable-xctest" if args .enable_swift_testing else None
218
244
call (
219
- filterNone (
245
+ filterNoneAndEmpty (
220
246
[
221
247
"swift" ,
222
248
"run" ,
249
+ * args .additional_run_args .split (" " ),
223
250
"swift-test" ,
224
251
* global_args ,
225
252
"--configuration" ,
226
253
args .config ,
227
254
"--parallel" ,
228
- swift_testing_arg ,
229
- xctest_arg ,
255
+ "--enable-swift-testing" if args . enable_swift_testing else None ,
256
+ "--enable-xctest" if args . enable_swift_testing else None ,
230
257
"--scratch-path" ,
231
258
".test" ,
232
259
* ignore_args ,
260
+ * args .additional_test_args .split (" " )
233
261
]
234
262
)
235
263
)
236
264
237
265
integration_test_dir = (REPO_ROOT_PATH / "IntegrationTests" ).as_posix ()
238
266
call (
239
- filterNone (
267
+ filterNoneAndEmpty (
240
268
[
241
269
"swift" ,
242
270
"package" ,
@@ -247,21 +275,23 @@ def main() -> None:
247
275
)
248
276
)
249
277
call (
250
- filterNone (
251
- [
278
+ filterNoneAndEmpty (
279
+ [
252
280
"swift" ,
253
281
"run" ,
282
+ * args .additional_run_args .split (" " ),
254
283
"swift-test" ,
255
284
* global_args ,
256
285
"--package-path" ,
257
286
integration_test_dir ,
258
287
"--parallel" ,
259
288
* ignore_args ,
289
+ * args .additional_integration_test_args .split (" " )
260
290
]
261
291
)
262
292
)
263
293
264
- if is_on_darwin ():
294
+ if is_on_darwin () and not args . skip_bootstrap :
265
295
run_bootstrap (swiftpm_bin_dir = swiftpm_bin_dir )
266
296
logging .info ("Done" )
267
297
0 commit comments