Bug 1406310 - Also ship clang-format in the clang-tidy build job r?glandium draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 06 Oct 2017 09:50:48 +0200
changeset 675915 ab4244397ff8eaa23b24108a0bde1b54252d27fd
parent 675689 19b32a138d08f73961df878a29de6f0aad441683
child 734764 d08db3b263e31f372c7ae05d8d5a9565eff3d237
push id83301
push userbmo:sledru@mozilla.com
push dateFri, 06 Oct 2017 07:51:16 +0000
reviewersglandium
bugs1406310
milestone58.0a1
Bug 1406310 - Also ship clang-format in the clang-tidy build job r?glandium MozReview-Commit-ID: 4C992sYlMo2
build/build-clang/build-clang.py
--- 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)