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 """MB - the Meta-Build wrapper around GYP and GN | 6 """MB - the Meta-Build wrapper around GYP and GN |
7 | 7 |
8 MB is a wrapper script for GYP and GN that can be used to generate build files | 8 MB is a wrapper script for GYP and GN that can be used to generate build files |
9 for sets of canned configurations and analyze them. | 9 for sets of canned configurations and analyze them. |
10 """ | 10 """ |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 matching_targets.append(build_output) | 681 matching_targets.append(build_output) |
682 | 682 |
683 cmd = self.GNCmd('refs', self.args.path[0]) + [ | 683 cmd = self.GNCmd('refs', self.args.path[0]) + [ |
684 '@%s' % response_file.name, '--all'] | 684 '@%s' % response_file.name, '--all'] |
685 ret, out, _ = self.Run(cmd) | 685 ret, out, _ = self.Run(cmd) |
686 if ret and not 'The input matches no targets' in out: | 686 if ret and not 'The input matches no targets' in out: |
687 self.WriteFailureAndRaise('gn refs returned %d: %s' % (ret, out), | 687 self.WriteFailureAndRaise('gn refs returned %d: %s' % (ret, out), |
688 output_path) | 688 output_path) |
689 for label in out.splitlines(): | 689 for label in out.splitlines(): |
690 build_target = label[2:] | 690 build_target = label[2:] |
691 # We want to accept 'chrome/android:chrome_shell_apk' and | 691 # We want to accept 'chrome/android:chrome_public_apk' and |
692 # just 'chrome_shell_apk'. This may result in too many targets | 692 # just 'chrome_public_apk'. This may result in too many targets |
693 # getting built, but we can adjust that later if need be. | 693 # getting built, but we can adjust that later if need be. |
694 for input_target in inp['targets']: | 694 for input_target in inp['targets']: |
695 if (input_target == build_target or | 695 if (input_target == build_target or |
696 build_target.endswith(':' + input_target)): | 696 build_target.endswith(':' + input_target)): |
697 matching_targets.append(input_target) | 697 matching_targets.append(input_target) |
698 finally: | 698 finally: |
699 self.RemoveFile(response_file.name) | 699 self.RemoveFile(response_file.name) |
700 | 700 |
701 if matching_targets: | 701 if matching_targets: |
702 # TODO: it could be that a target X might depend on a target Y | 702 # TODO: it could be that a target X might depend on a target Y |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 826 |
827 if __name__ == '__main__': | 827 if __name__ == '__main__': |
828 try: | 828 try: |
829 sys.exit(main(sys.argv[1:])) | 829 sys.exit(main(sys.argv[1:])) |
830 except MBErr as e: | 830 except MBErr as e: |
831 print(e) | 831 print(e) |
832 sys.exit(1) | 832 sys.exit(1) |
833 except KeyboardInterrupt: | 833 except KeyboardInterrupt: |
834 print("interrupted, exiting", stream=sys.stderr) | 834 print("interrupted, exiting", stream=sys.stderr) |
835 sys.exit(130) | 835 sys.exit(130) |
OLD | NEW |