| 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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 raise | 1277 raise |
| 1278 | 1278 |
| 1279 outp = {} | 1279 outp = {} |
| 1280 if 'status' in gn_outp: | 1280 if 'status' in gn_outp: |
| 1281 outp['status'] = gn_outp['status'] | 1281 outp['status'] = gn_outp['status'] |
| 1282 if 'error' in gn_outp: | 1282 if 'error' in gn_outp: |
| 1283 outp['error'] = gn_outp['error'] | 1283 outp['error'] = gn_outp['error'] |
| 1284 if 'invalid_targets' in gn_outp: | 1284 if 'invalid_targets' in gn_outp: |
| 1285 outp['invalid_targets'] = gn_outp['invalid_targets'] | 1285 outp['invalid_targets'] = gn_outp['invalid_targets'] |
| 1286 if 'compile_targets' in gn_outp: | 1286 if 'compile_targets' in gn_outp: |
| 1287 outp['compile_targets'] = [ | 1287 if 'all' in gn_outp['compile_targets']: |
| 1288 label.replace('//', '') for label in gn_outp['compile_targets']] | 1288 outp['compile_targets'] = ['all'] |
| 1289 else: |
| 1290 outp['compile_targets'] = [ |
| 1291 label.replace('//', '') for label in gn_outp['compile_targets']] |
| 1289 if 'test_targets' in gn_outp: | 1292 if 'test_targets' in gn_outp: |
| 1290 outp['test_targets'] = [ | 1293 outp['test_targets'] = [ |
| 1291 labels_to_targets[label] for label in gn_outp['test_targets']] | 1294 labels_to_targets[label] for label in gn_outp['test_targets']] |
| 1292 | 1295 |
| 1293 if self.args.verbose: | 1296 if self.args.verbose: |
| 1294 self.Print() | 1297 self.Print() |
| 1295 self.Print('analyze output:') | 1298 self.Print('analyze output:') |
| 1296 self.PrintJSON(outp) | 1299 self.PrintJSON(outp) |
| 1297 self.Print() | 1300 self.Print() |
| 1298 | 1301 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 # Then check to see if the arg contains any metacharacters other than | 1523 # Then check to see if the arg contains any metacharacters other than |
| 1521 # double quotes; if it does, quote everything (including the double | 1524 # double quotes; if it does, quote everything (including the double |
| 1522 # quotes) for safety. | 1525 # quotes) for safety. |
| 1523 if any(a in UNSAFE_FOR_CMD for a in arg): | 1526 if any(a in UNSAFE_FOR_CMD for a in arg): |
| 1524 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1527 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
| 1525 return arg | 1528 return arg |
| 1526 | 1529 |
| 1527 | 1530 |
| 1528 if __name__ == '__main__': | 1531 if __name__ == '__main__': |
| 1529 sys.exit(main(sys.argv[1:])) | 1532 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |