6
6
import subprocess
7
7
import sys
8
8
import tempfile
9
+ from concurrent .futures import ThreadPoolExecutor
9
10
from typing import Dict , List , Optional
10
11
11
12
@@ -206,14 +207,7 @@ def generate_gyb_files_helper(
206
207
clear_gyb_files_from_previous_run (
207
208
sources_dir , destination_dir , verbose )
208
209
209
- # Generate the new .swift files in `temp_files_dir` and only copy them
210
- # to `destiantion_dir` if they are different than the
211
- # files already residing there. This way we don't touch the generated .swift
212
- # files if they haven't changed and don't trigger a rebuild.
213
- for gyb_file in os .listdir (sources_dir ):
214
- if not gyb_file .endswith (".gyb" ):
215
- continue
216
-
210
+ def generate_gyb_file (gyb_file ):
217
211
gyb_file_path = os .path .join (sources_dir , gyb_file )
218
212
219
213
# Slice off the '.gyb' to get the name for the output file
@@ -230,6 +224,14 @@ def generate_gyb_files_helper(
230
224
verbose = verbose ,
231
225
)
232
226
227
+ # Generate the new .swift files in `temp_files_dir` and only copy them
228
+ # to `destiantion_dir` if they are different than the
229
+ # files already residing there. This way we don't touch the generated .swift
230
+ # files if they haven't changed and don't trigger a rebuild.
231
+ gyb_files = [file for file in os .listdir (sources_dir ) if file .endswith (".gyb" )]
232
+ with ThreadPoolExecutor () as executor :
233
+ executor .map (generate_gyb_file , gyb_files )
234
+
233
235
234
236
# Generate the syntax node `.swift` files from `SyntaxNodes.swift.gyb.template`.
235
237
# `destination_dir` is not `None`, the resulting files will be written to
@@ -789,7 +791,6 @@ def test_command(args):
789
791
skip_lit_tests = args .skip_lit_tests ,
790
792
verbose = args .verbose ,
791
793
)
792
- print ("** All tests passed **" )
793
794
except subprocess .CalledProcessError as e :
794
795
fail_for_called_process_error ("Running tests failed" , e )
795
796
0 commit comments