Bug 1406310 - Also ship clang-format in the clang-tidy build job r?glandium
MozReview-Commit-ID: 4C992sYlMo2
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -252,18 +252,19 @@ def get_tool(config, key):
# This function is intended to be called on the final build directory when
# building clang-tidy. Its job is to remove all of the files which won't
# be used for clang-tidy to reduce the download size. Currently when this
# function finishes its job, it will leave final_dir with a layout like this:
#
# clang/
# bin/
+# clang-apply-replacements
+# clang-format
# clang-tidy
-# clang-apply-replacements
# include/
# * (nothing will be deleted here)
# lib/
# clang/
# 4.0.0/
# include/
# * (nothing will be deleted here)
# share/
@@ -277,17 +278,17 @@ def prune_final_dir_for_clang_tidy(final
if os.path.basename(f) not in dirs:
raise Exception("Found unknown file %s in the final directory" % f)
if not os.path.isdir(f):
raise Exception("Expected %s to be a directory" %f)
# In bin/, only keep clang-tidy and clang-apply-replacements. The last one
# is used to auto-fix some of the issues detected by clang-tidy.
re_clang_tidy = re.compile(
- r"^clang-(tidy|apply-replacements)(\.exe)?$", re.I)
+ r"^clang-(apply-replacements|format|tidy)(\.exe)?$", re.I)
for f in glob.glob("%s/bin/*" % final_dir):
if re_clang_tidy.search(os.path.basename(f)) is None:
delete(f)
# Keep include/ intact.
# In lib/, only keep lib/clang/N.M.O/include.
re_ver_num = re.compile(r"^\d+\.\d+\.\d+$", re.I)