| 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 def RunGNGen(self, vals): | 715 def RunGNGen(self, vals): |
| 716 build_dir = self.args.path[0] | 716 build_dir = self.args.path[0] |
| 717 | 717 |
| 718 cmd = self.GNCmd('gen', build_dir, '--check') | 718 cmd = self.GNCmd('gen', build_dir, '--check') |
| 719 gn_args = self.GNArgs(vals) | 719 gn_args = self.GNArgs(vals) |
| 720 | 720 |
| 721 # Since GN hasn't run yet, the build directory may not even exist. | 721 # Since GN hasn't run yet, the build directory may not even exist. |
| 722 self.MaybeMakeDirectory(self.ToAbsPath(build_dir)) | 722 self.MaybeMakeDirectory(self.ToAbsPath(build_dir)) |
| 723 | 723 |
| 724 gn_args_path = self.ToAbsPath(build_dir, 'args.gn') | 724 gn_args_path = self.ToAbsPath(build_dir, 'args.gn') |
| 725 self.WriteFile(gn_args_path, gn_args) | 725 self.WriteFile(gn_args_path, gn_args, force_verbose=True) |
| 726 | 726 |
| 727 swarming_targets = [] | 727 swarming_targets = [] |
| 728 if getattr(self.args, 'swarming_targets_file', None): | 728 if getattr(self.args, 'swarming_targets_file', None): |
| 729 # We need GN to generate the list of runtime dependencies for | 729 # We need GN to generate the list of runtime dependencies for |
| 730 # the compile targets listed (one per line) in the file so | 730 # the compile targets listed (one per line) in the file so |
| 731 # we can run them via swarming. We use ninja_to_gn.pyl to convert | 731 # we can run them via swarming. We use ninja_to_gn.pyl to convert |
| 732 # the compile targets to the matching GN labels. | 732 # the compile targets to the matching GN labels. |
| 733 path = self.args.swarming_targets_file | 733 path = self.args.swarming_targets_file |
| 734 if not self.Exists(path): | 734 if not self.Exists(path): |
| 735 self.WriteFailureAndRaise('"%s" does not exist' % path, | 735 self.WriteFailureAndRaise('"%s" does not exist' % path, |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 # Then check to see if the arg contains any metacharacters other than | 1412 # Then check to see if the arg contains any metacharacters other than |
| 1413 # double quotes; if it does, quote everything (including the double | 1413 # double quotes; if it does, quote everything (including the double |
| 1414 # quotes) for safety. | 1414 # quotes) for safety. |
| 1415 if any(a in UNSAFE_FOR_CMD for a in arg): | 1415 if any(a in UNSAFE_FOR_CMD for a in arg): |
| 1416 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1416 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
| 1417 return arg | 1417 return arg |
| 1418 | 1418 |
| 1419 | 1419 |
| 1420 if __name__ == '__main__': | 1420 if __name__ == '__main__': |
| 1421 sys.exit(main(sys.argv[1:])) | 1421 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |