Skip to content

[build-script-helper] Switch the --no-clean flag to --clean and have it actually do something #1558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Utilities/build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ def handle_invocation(swift_exec: str, args: argparse.Namespace) -> None:
"""
Depending on the action in 'args', build the package, installs the package or run tests.
"""
if args.clean:
print('Cleaning ' + args.build_path)
shutil.rmtree(args.build_path, ignore_errors=True)

if args.action == 'build':
build_single_product("sourcekit-lsp", swift_exec, args)
elif args.action == 'test':
Expand All @@ -287,7 +291,7 @@ def add_common_args(parser: argparse.ArgumentParser) -> None:
parser.add_argument('--no-local-deps', action='store_true', help='use normal remote dependencies when building')
parser.add_argument('--sanitize', action='append', help='build using the given sanitizer(s) (address|thread|undefined)')
parser.add_argument('--sanitize-all', action='store_true', help='build using every available sanitizer in sub-directories of build path')
parser.add_argument('--no-clean', action='store_true', help='Don\'t clean the build directory prior to performing the action')
parser.add_argument('--clean', action='store_true', help='Clean the build directory prior to performing the action')
parser.add_argument('--verbose', '-v', action='store_true', help='enable verbose output')
parser.add_argument('--cross-compile-host', help='cross-compile for another host instead')
parser.add_argument('--cross-compile-config', help='an SPM JSON destination file containing Swift cross-compilation flags')
Expand Down