Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: tools/mb/mb.py

Issue 1411183010: Make MB aware of iOS bot configs and get iOS working. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to #360460, clean up Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/mb/docs/user_guide.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mb/mb.py
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index b733345166d1dab5010805d2139a19707641cd37..3c0fa49016669b4412e1acee80a8ebf7197b9f06 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -344,13 +344,15 @@ class MetaBuildWrapper(object):
}
def Lookup(self):
- self.ReadConfigFile()
- config = self.ConfigFromArgs()
- if not config in self.configs:
- raise MBErr('Config "%s" not found in %s' %
- (config, self.args.config_file))
+ vals = self.ReadBotConfig()
+ if not vals:
+ self.ReadConfigFile()
+ config = self.ConfigFromArgs()
+ if not config in self.configs:
+ raise MBErr('Config "%s" not found in %s' %
+ (config, self.args.config_file))
- vals = self.FlattenConfig(config)
+ vals = self.FlattenConfig(config)
# Do some basic sanity checking on the config so that we
# don't have to do this in every caller.
@@ -360,6 +362,28 @@ class MetaBuildWrapper(object):
return vals
+ def ReadBotConfig(self):
+ if not self.args.master or not self.args.builder:
+ return {}
+ path = self.PathJoin(self.chromium_src_dir, 'ios', 'build', 'bots',
+ self.args.master, self.args.builder + '.json')
+ if not self.Exists(path):
+ return {}
+
+ contents = json.loads(self.ReadFile(path))
+ gyp_vals = contents.get('GYP_DEFINES', {})
+ if isinstance(gyp_vals, dict):
+ gyp_defines = ' '.join('%s=%s' % (k, v) for k, v in gyp_vals.items())
+ else:
+ gyp_defines = ' '.join(gyp_vals)
+ gn_args = ' '.join(contents.get('gn_args', []))
+
+ return {
+ 'type': contents.get('mb_type', ''),
+ 'gn_args': gn_args,
+ 'gyp_defines': gyp_defines,
+ }
+
def ReadConfigFile(self):
if not self.Exists(self.args.config_file):
raise MBErr('config file not found at %s' % self.args.config_file)
« no previous file with comments | « tools/mb/docs/user_guide.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698