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

Side by Side Diff: tools/mb/mb.py

Issue 1078913003: Fix error code propagation in 'mb gen'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up test code Created 5 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/mb/mb_unittest.py » ('j') | tools/mb/mb_unittest.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if vals['type'] == 'gn': 115 if vals['type'] == 'gn':
116 return self.RunGNAnalyze(vals) 116 return self.RunGNAnalyze(vals)
117 elif vals['type'] == 'gyp': 117 elif vals['type'] == 'gyp':
118 return self.RunGYPAnalyze(vals) 118 return self.RunGYPAnalyze(vals)
119 else: 119 else:
120 raise MBErr('Unknown meta-build type "%s"' % vals['type']) 120 raise MBErr('Unknown meta-build type "%s"' % vals['type'])
121 121
122 def CmdGen(self): 122 def CmdGen(self):
123 vals = self.GetConfig() 123 vals = self.GetConfig()
124 if vals['type'] == 'gn': 124 if vals['type'] == 'gn':
125 self.RunGNGen(self.args.path[0], vals) 125 return self.RunGNGen(self.args.path[0], vals)
126 elif vals['type'] == 'gyp': 126 if vals['type'] == 'gyp':
127 self.RunGYPGen(self.args.path[0], vals) 127 return self.RunGYPGen(self.args.path[0], vals)
128 else: 128
129 raise MBErr('Unknown meta-build type "%s"' % vals['type']) 129 raise MBErr('Unknown meta-build type "%s"' % vals['type'])
130 return 0
131 130
132 def CmdLookup(self): 131 def CmdLookup(self):
133 vals = self.GetConfig() 132 vals = self.GetConfig()
134 if vals['type'] == 'gn': 133 if vals['type'] == 'gn':
135 cmd = self.GNCmd('gen', '<path>', vals['gn_args']) 134 cmd = self.GNCmd('gen', '<path>', vals['gn_args'])
136 elif vals['type'] == 'gyp': 135 elif vals['type'] == 'gyp':
137 cmd = self.GYPCmd('<path>', vals['gyp_defines'], vals['gyp_config']) 136 cmd = self.GYPCmd('<path>', vals['gyp_defines'], vals['gyp_config'])
138 else: 137 else:
139 raise MBErr('Unknown meta-build type "%s"' % vals['type']) 138 raise MBErr('Unknown meta-build type "%s"' % vals['type'])
140 139
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 547
549 if __name__ == '__main__': 548 if __name__ == '__main__':
550 try: 549 try:
551 sys.exit(main(sys.argv[1:])) 550 sys.exit(main(sys.argv[1:]))
552 except MBErr as e: 551 except MBErr as e:
553 print(e) 552 print(e)
554 sys.exit(1) 553 sys.exit(1)
555 except KeyboardInterrupt: 554 except KeyboardInterrupt:
556 print("interrupted, exiting", stream=sys.stderr) 555 print("interrupted, exiting", stream=sys.stderr)
557 sys.exit(130) 556 sys.exit(130)
OLDNEW
« no previous file with comments | « no previous file | tools/mb/mb_unittest.py » ('j') | tools/mb/mb_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698