Index: scripts/slave/recipe_modules/chromium/api.py |
diff --git a/scripts/slave/recipe_modules/chromium/api.py b/scripts/slave/recipe_modules/chromium/api.py |
index 479e0cd5532059e348714a061792241b723ae4eb..d5753858b4b89ebacd6b0892dbf904feb3dad968 100644 |
--- a/scripts/slave/recipe_modules/chromium/api.py |
+++ b/scripts/slave/recipe_modules/chromium/api.py |
@@ -562,24 +562,33 @@ class ChromiumApi(recipe_api.RecipeApi): |
'--args=%s' % ' '.join(gn_args), |
]) |
+ def run_mb_if_necessary(self, mastername, buildername, tests): |
+ if self.c.project_generator.tool == 'mb': |
+ self.run_mb(mastername, buildername, |
+ swarming_targets=[t.name for t in tests if t.uses_swarming]) |
+ |
def run_mb(self, mastername, buildername, use_goma=True, |
- mb_config_path=None): |
+ mb_config_path=None, swarming_targets=None): |
mb_config_path = (mb_config_path or |
self.m.path['checkout'].join('tools', 'mb', |
'mb_config.pyl')) |
+ swarming_targets = swarming_targets or [] |
+ |
args=[ |
'gen', '-v', |
'-m', mastername, |
'-b', buildername, |
'--config-file', mb_config_path, |
] |
+ |
if use_goma: |
- args += [ |
- '--goma-dir', self.m.path['build'].join('goma'), |
- ] |
- args += [ |
- '//out/%s' % self.c.build_config_fs |
- ] |
+ args += ['--goma-dir', self.m.path['build'].join('goma')] |
+ |
+ if swarming_targets: |
+ data = '\n'.join(swarming_targets) + '\n' |
+ args += ['--swarming-targets-file', self.m.raw_io.input(data)] |
+ |
+ args += ['//out/%s' % self.c.build_config_fs] |
# This runs with no env being passed along, so we get a clean environment |
# without any GYP_DEFINES being present to cause confusion. |