| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 """Checks that released mojom.dart files in the source tree are up to date""" | 6 """Checks that released mojom.dart files in the source tree are up to date""" |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 updated_mojom_dart_files = [] | 315 updated_mojom_dart_files = [] |
| 316 packages_with_failures = [] | 316 packages_with_failures = [] |
| 317 check_failure = False | 317 check_failure = False |
| 318 | 318 |
| 319 # Check for updated .mojom without updated .mojom.dart | 319 # Check for updated .mojom without updated .mojom.dart |
| 320 for mojom_file in mojoms: | 320 for mojom_file in mojoms: |
| 321 try: | 321 try: |
| 322 mojom = _load_mojom(mojom_file) | 322 mojom = _load_mojom(mojom_file) |
| 323 except Exception: | 323 except Exception: |
| 324 # Could not load .mojom file | 324 # Could not load .mojom file |
| 325 print("Could not load mojom file: %s" % mojom_file) |
| 325 return True | 326 return True |
| 326 | 327 |
| 327 package = _mojom_package(mojom) | 328 package = _mojom_package(mojom) |
| 328 # If a mojom doesn't have a package, ignore it. | 329 # If a mojom doesn't have a package, ignore it. |
| 329 if not package: | 330 if not package: |
| 330 continue | 331 continue |
| 331 package_dir = packages.get(package) | 332 package_dir = packages.get(package) |
| 332 # If the package isn't a known package, ignore it. | 333 # If the package isn't a known package, ignore it. |
| 333 if not package_dir: | 334 if not package_dir: |
| 334 continue | 335 continue |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 if args.affected_files: | 402 if args.affected_files: |
| 402 check_failure = presubmit_check(packages, args.affected_files) | 403 check_failure = presubmit_check(packages, args.affected_files) |
| 403 else: | 404 else: |
| 404 check_failure = global_check(packages) | 405 check_failure = global_check(packages) |
| 405 if check_failure: | 406 if check_failure: |
| 406 return 2 | 407 return 2 |
| 407 return 0 | 408 return 0 |
| 408 | 409 |
| 409 if __name__ == '__main__': | 410 if __name__ == '__main__': |
| 410 sys.exit(main()) | 411 sys.exit(main()) |
| OLD | NEW |