Bug 1839316: part 5) Guard the "fetchpriority" attribute behind a pref. r=kershaw...
[gecko.git] / build / clang-plugin / ThirdPartyPaths.py
blobcaaa919d43f280dea4c17cfec31fb8661c304863
1 #!/usr/bin/env python3
3 import json
6 def generate(output, *input_paths):
7 """
8 This file generates a ThirdPartyPaths.cpp file from the ThirdPartyPaths.txt
9 file in /tools/rewriting, which is used by the Clang Plugin to help identify
10 sources which should be ignored.
11 """
12 tpp_list = []
13 lines = set()
15 for path in input_paths:
16 with open(path) as f:
17 lines.update(f.readlines())
19 for line in lines:
20 line = line.strip()
21 if line.endswith("/"):
22 line = line[:-1]
23 tpp_list.append(line)
24 tpp_strings = ",\n ".join([json.dumps(tpp) for tpp in sorted(tpp_list)])
26 output.write(
27 """\
28 /* THIS FILE IS GENERATED BY ThirdPartyPaths.py - DO NOT EDIT */
30 #include <stdint.h>
32 const char* MOZ_THIRD_PARTY_PATHS[] = {
36 extern const uint32_t MOZ_THIRD_PARTY_PATHS_COUNT = %d;
38 """
39 % (tpp_strings, len(tpp_list))