Commit a3f177dc authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Add support for --root and --dotfile to MB.

This allows callers to pass through --root and --dotfile args
to GN as needed.

Bug: 1133857
Change-Id: Id92c614c0c09f3cf94e43b4a50f2f9354b0392e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440477Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#812537}
parent a46f4886
......@@ -151,6 +151,8 @@ class MetaBuildWrapper(object):
'the commands that will run)')
subp.add_argument('-v', '--verbose', action='store_true',
help='verbose logging')
subp.add_argument('--root', help='Path to GN source root')
subp.add_argument('--dotfile', help='Path to GN dotfile')
# TODO(crbug.com/1060857): Remove this once swarming task templates
# support command prefixes.
......@@ -1342,7 +1344,12 @@ class MetaBuildWrapper(object):
subdir, exe = 'win', 'gn.exe'
gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe)
return [gn_path, subcommand, path] + list(args)
cmd = [gn_path, subcommand]
if self.args.root:
cmd += ['--root=' + self.args.root]
if self.args.dotfile:
cmd += ['--dotfile=' + self.args.dotfile]
return cmd + [path] + list(args)
def GNArgs(self, vals, expand_imports=False):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment