OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
10 | 10 |
11 """ | 11 """ |
12 This tool tries to fix (some) errors reported by `gn gen --check` or | 12 This tool tries to fix (some) errors reported by `gn gen --check` or |
13 `gn check`. | 13 `gn check`. |
14 It will run `mb gen` in a temporary directory and it is really useful to | 14 It will run `mb gen` in a temporary directory and it is really useful to |
15 check for different configurations. | 15 check for different configurations. |
16 | 16 |
17 Usage: | 17 Usage: |
18 $ python tools-webrtc/gn_check_autofix.py -m some_mater -b some_bot | 18 $ python tools_webrtc/gn_check_autofix.py -m some_mater -b some_bot |
19 or | 19 or |
20 $ python tools-webrtc/gn_check_autofix.py -c some_mb_config | 20 $ python tools_webrtc/gn_check_autofix.py -c some_mb_config |
21 """ | 21 """ |
22 | 22 |
23 import os | 23 import os |
24 import re | 24 import re |
25 import shutil | 25 import shutil |
26 import subprocess | 26 import subprocess |
27 import sys | 27 import sys |
28 import tempfile | 28 import tempfile |
29 | 29 |
30 from collections import defaultdict | 30 from collections import defaultdict |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 print '\n'.join(error) | 149 print '\n'.join(error) |
150 continue | 150 continue |
151 | 151 |
152 for path, missing_deps in errors_by_file.items(): | 152 for path, missing_deps in errors_by_file.items(): |
153 FixErrors(path, missing_deps, deleted_sources) | 153 FixErrors(path, missing_deps, deleted_sources) |
154 | 154 |
155 return 0 | 155 return 0 |
156 | 156 |
157 if __name__ == '__main__': | 157 if __name__ == '__main__': |
158 sys.exit(main()) | 158 sys.exit(main()) |
OLD | NEW |