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 |
166 | 167 |
167 missing = sorted(missing) | 168 missing = sorted(missing) |
168 nonexisting = sorted(nonexisting) | 169 nonexisting = sorted(nonexisting) |
169 | 170 |
170 if args.json: | 171 if args.json: |
171 with open(args.json, 'w') as f: | 172 with open(args.json, 'w') as f: |
172 json.dump(missing, f) | 173 json.dump(sorted(missing + nonexisting), f) |
173 | 174 |
174 if len(missing) == 0 and len(nonexisting) == 0: | 175 if len(missing) == 0 and len(nonexisting) == 0: |
175 return 0 | 176 return 0 |
176 | 177 |
177 if len(missing) > 0: | 178 if len(missing) > 0: |
178 print '\nThe following files should be included in gn files:' | 179 print '\nThe following files should be included in gn files:' |
179 for i in missing: | 180 for i in missing: |
180 print i | 181 print i |
181 | 182 |
182 if len(nonexisting) > 0: | 183 if len(nonexisting) > 0: |
183 print '\nThe following non-existing files should be removed from gn files:' | 184 print '\nThe following non-existing files should be removed from gn files:' |
184 for i in nonexisting: | 185 for i in nonexisting: |
185 print i | 186 print i |
186 | 187 |
187 return 1 | 188 return 1 |
188 | 189 |
189 | 190 |
190 if __name__ == '__main__': | 191 if __name__ == '__main__': |
191 sys.exit(main()) | 192 sys.exit(main()) |
OLD | NEW |