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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 subp.add_argument('-m', '--master', | 77 subp.add_argument('-m', '--master', |
78 help='master name to look up config from') | 78 help='master name to look up config from') |
79 subp.add_argument('-c', '--config', | 79 subp.add_argument('-c', '--config', |
80 help='configuration to analyze') | 80 help='configuration to analyze') |
81 subp.add_argument('-f', '--config-file', metavar='PATH', | 81 subp.add_argument('-f', '--config-file', metavar='PATH', |
82 default=self.default_config, | 82 default=self.default_config, |
83 help='path to config file ' | 83 help='path to config file ' |
84 '(default is //tools/mb/mb_config.pyl)') | 84 '(default is //tools/mb/mb_config.pyl)') |
85 subp.add_argument('-g', '--goma-dir', | 85 subp.add_argument('-g', '--goma-dir', |
86 help='path to goma directory') | 86 help='path to goma directory') |
87 subp.add_argument('--gyp-script', | |
Michael Achenbach
2016/06/03 07:36:38
FYI: I didn't specify a default here to keep the t
Dirk Pranke
2016/06/03 17:59:24
I don't quite understand this comment; PathJoin()
Michael Achenbach
2016/06/03 19:55:03
That's what I tried. PathJoin was not defined in t
| |
88 help='path to gyp script relative to project root ' | |
89 '(default is build/gyp_chromium)') | |
87 subp.add_argument('--android-version-code', | 90 subp.add_argument('--android-version-code', |
88 help='Sets GN arg android_default_version_code and ' | 91 help='Sets GN arg android_default_version_code and ' |
89 'GYP_DEFINE app_manifest_version_code') | 92 'GYP_DEFINE app_manifest_version_code') |
90 subp.add_argument('--android-version-name', | 93 subp.add_argument('--android-version-name', |
91 help='Sets GN arg android_default_version_name and ' | 94 help='Sets GN arg android_default_version_name and ' |
92 'GYP_DEFINE app_manifest_version_name') | 95 'GYP_DEFINE app_manifest_version_name') |
93 subp.add_argument('-n', '--dryrun', action='store_true', | 96 subp.add_argument('-n', '--dryrun', action='store_true', |
94 help='Do a dry run (i.e., do nothing, just print ' | 97 help='Do a dry run (i.e., do nothing, just print ' |
95 'the commands that will run)') | 98 'the commands that will run)') |
96 subp.add_argument('-v', '--verbose', action='store_true', | 99 subp.add_argument('-v', '--verbose', action='store_true', |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1098 android_version_code = self.args.android_version_code | 1101 android_version_code = self.args.android_version_code |
1099 if android_version_code: | 1102 if android_version_code: |
1100 gyp_defines += ' app_manifest_version_code=%s' % android_version_code | 1103 gyp_defines += ' app_manifest_version_code=%s' % android_version_code |
1101 | 1104 |
1102 android_version_name = self.args.android_version_name | 1105 android_version_name = self.args.android_version_name |
1103 if android_version_name: | 1106 if android_version_name: |
1104 gyp_defines += ' app_manifest_version_name=%s' % android_version_name | 1107 gyp_defines += ' app_manifest_version_name=%s' % android_version_name |
1105 | 1108 |
1106 cmd = [ | 1109 cmd = [ |
1107 self.executable, | 1110 self.executable, |
1108 self.PathJoin('build', 'gyp_chromium'), | 1111 self.args.gyp_script or self.PathJoin('build', 'gyp_chromium'), |
1109 '-G', | 1112 '-G', |
1110 'output_dir=' + output_dir, | 1113 'output_dir=' + output_dir, |
1111 ] | 1114 ] |
1112 | 1115 |
1113 # Ensure that we have an environment that only contains | 1116 # Ensure that we have an environment that only contains |
1114 # the exact values of the GYP variables we need. | 1117 # the exact values of the GYP variables we need. |
1115 env = os.environ.copy() | 1118 env = os.environ.copy() |
1116 | 1119 |
1117 # This is a terrible hack to work around the fact that | 1120 # This is a terrible hack to work around the fact that |
1118 # //tools/clang/scripts/update.py is invoked by GYP and GN but | 1121 # //tools/clang/scripts/update.py is invoked by GYP and GN but |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1466 # Then check to see if the arg contains any metacharacters other than | 1469 # Then check to see if the arg contains any metacharacters other than |
1467 # double quotes; if it does, quote everything (including the double | 1470 # double quotes; if it does, quote everything (including the double |
1468 # quotes) for safety. | 1471 # quotes) for safety. |
1469 if any(a in UNSAFE_FOR_CMD for a in arg): | 1472 if any(a in UNSAFE_FOR_CMD for a in arg): |
1470 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) | 1473 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) |
1471 return arg | 1474 return arg |
1472 | 1475 |
1473 | 1476 |
1474 if __name__ == '__main__': | 1477 if __name__ == '__main__': |
1475 sys.exit(main(sys.argv[1:])) | 1478 sys.exit(main(sys.argv[1:])) |
OLD | NEW |