OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2017 The Chromium Authors. All rights reserved. | 2 # Copyright 2017 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Find header files missing in GN. | 6 """Find header files missing in GN. |
7 | 7 |
8 This script gets all the header files from ninja_deps, which is from the true | 8 This script gets all the header files from ninja_deps, which is from the true |
9 dependency generated by the compiler, and report if they don't exist in GN. | 9 dependency generated by the compiler, and report if they don't exist in GN. |
10 """ | 10 """ |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 missing = FilterOutDepsedRepo(missing, deps) | 156 missing = FilterOutDepsedRepo(missing, deps) |
157 nonexisting = FilterOutDepsedRepo(nonexisting, deps) | 157 nonexisting = FilterOutDepsedRepo(nonexisting, deps) |
158 | 158 |
159 d_p.join() | 159 d_p.join() |
160 gn_p.join() | 160 gn_p.join() |
161 deps_p.join() | 161 deps_p.join() |
162 | 162 |
163 if args.whitelist: | 163 if args.whitelist: |
164 whitelist = ParseWhiteList(open(args.whitelist).read()) | 164 whitelist = ParseWhiteList(open(args.whitelist).read()) |
165 missing -= whitelist | 165 missing -= whitelist |
166 nonexisting -= whitelist | |
167 | 166 |
168 missing = sorted(missing) | 167 missing = sorted(missing) |
169 nonexisting = sorted(nonexisting) | 168 nonexisting = sorted(nonexisting) |
170 | 169 |
171 if args.json: | 170 if args.json: |
172 with open(args.json, 'w') as f: | 171 with open(args.json, 'w') as f: |
173 json.dump(sorted(missing + nonexisting), f) | 172 json.dump(missing, f) |
174 | 173 |
175 if len(missing) == 0 and len(nonexisting) == 0: | 174 if len(missing) == 0 and len(nonexisting) == 0: |
176 return 0 | 175 return 0 |
177 | 176 |
178 if len(missing) > 0: | 177 if len(missing) > 0: |
179 print '\nThe following files should be included in gn files:' | 178 print '\nThe following files should be included in gn files:' |
180 for i in missing: | 179 for i in missing: |
181 print i | 180 print i |
182 | 181 |
183 if len(nonexisting) > 0: | 182 if len(nonexisting) > 0: |
184 print '\nThe following non-existing files should be removed from gn files:' | 183 print '\nThe following non-existing files should be removed from gn files:' |
185 for i in nonexisting: | 184 for i in nonexisting: |
186 print i | 185 print i |
187 | 186 |
188 return 1 | 187 return 1 |
189 | 188 |
190 | 189 |
191 if __name__ == '__main__': | 190 if __name__ == '__main__': |
192 sys.exit(main()) | 191 sys.exit(main()) |
OLD | NEW |