Skip to content

Commit 636bc1f

Browse files
committed
[build-script-helper] Switch the --no-clean flag to --clean and have it actually do something
Instead, swiftlang/swift#75053 makes sure `build-script` doesn't pass in the flag by default, so you can explicitly invoke it only when needed.
1 parent d21f7c0 commit 636bc1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Utilities/build-script-helper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ def handle_invocation(swift_exec: str, args: argparse.Namespace) -> None:
262262
"""
263263
Depending on the action in 'args', build the package, installs the package or run tests.
264264
"""
265+
if args.clean:
266+
print('Cleaning ' + args.build_path)
267+
shutil.rmtree(args.build_path, ignore_errors=True)
268+
265269
if args.action == 'build':
266270
build_single_product("sourcekit-lsp", swift_exec, args)
267271
elif args.action == 'test':
@@ -287,7 +291,7 @@ def add_common_args(parser: argparse.ArgumentParser) -> None:
287291
parser.add_argument('--no-local-deps', action='store_true', help='use normal remote dependencies when building')
288292
parser.add_argument('--sanitize', action='append', help='build using the given sanitizer(s) (address|thread|undefined)')
289293
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')
291295
parser.add_argument('--verbose', '-v', action='store_true', help='enable verbose output')
292296
parser.add_argument('--cross-compile-host', help='cross-compile for another host instead')
293297
parser.add_argument('--cross-compile-config', help='an SPM JSON destination file containing Swift cross-compilation flags')

0 commit comments

Comments
 (0)