@@ -262,6 +262,10 @@ def handle_invocation(swift_exec: str, args: argparse.Namespace) -> None:
262
262
"""
263
263
Depending on the action in 'args', build the package, installs the package or run tests.
264
264
"""
265
+ if args .clean :
266
+ print ('Cleaning ' + args .build_path )
267
+ shutil .rmtree (args .build_path , ignore_errors = True )
268
+
265
269
if args .action == 'build' :
266
270
build_single_product ("sourcekit-lsp" , swift_exec , args )
267
271
elif args .action == 'test' :
@@ -287,7 +291,7 @@ def add_common_args(parser: argparse.ArgumentParser) -> None:
287
291
parser .add_argument ('--no-local-deps' , action = 'store_true' , help = 'use normal remote dependencies when building' )
288
292
parser .add_argument ('--sanitize' , action = 'append' , help = 'build using the given sanitizer(s) (address|thread|undefined)' )
289
293
parser .add_argument ('--sanitize-all' , action = 'store_true' , help = 'build using every available sanitizer in sub-directories of build path' )
290
- parser .add_argument ('--no- clean' , action = 'store_true' , help = 'Don \' t clean the build directory prior to performing the action' )
294
+ parser .add_argument ('--clean' , action = 'store_true' , help = 'Clean the build directory prior to performing the action' )
291
295
parser .add_argument ('--verbose' , '-v' , action = 'store_true' , help = 'enable verbose output' )
292
296
parser .add_argument ('--cross-compile-host' , help = 'cross-compile for another host instead' )
293
297
parser .add_argument ('--cross-compile-config' , help = 'an SPM JSON destination file containing Swift cross-compilation flags' )
0 commit comments