Skip to content

Only remove gyb-generated files that don't exist anymore #153

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
Oct 8, 2019
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 build-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def generate_gyb_files(verbose, add_source_locations, tar_path):
# Clear any *.swift files that are relics from the previous run.
for previous_gyb_gen_file in os.listdir(generated_files_dir):
if previous_gyb_gen_file.endswith('.swift'):
check_call(['rm', previous_gyb_gen_file], cwd=generated_files_dir)
gyb_file = os.path.join(swiftsyntax_sources_dir,
previous_gyb_gen_file + '.gyb')
if not os.path.exists(gyb_file):
check_call(['rm', previous_gyb_gen_file], cwd=generated_files_dir,
verbose=verbose)

# Generate the new .swift files in a temporary directory and only copy them
# to Sources/SwiftSyntax/gyb_generated if they are different than the files
Expand Down