OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import json | 5 import json |
6 import optparse | 6 import optparse |
7 import os | 7 import os |
8 import pipes | 8 import pipes |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 callback=ConvertJson, type='string', default={}, | 71 callback=ConvertJson, type='string', default={}, |
72 help='factory properties in JSON format') | 72 help='factory properties in JSON format') |
73 return parser | 73 return parser |
74 | 74 |
75 | 75 |
76 def EncodeProperties(options): | 76 def EncodeProperties(options): |
77 return ['--factory-properties=%s' % json.dumps(options.factory_properties), | 77 return ['--factory-properties=%s' % json.dumps(options.factory_properties), |
78 '--build-properties=%s' % json.dumps(options.build_properties)] | 78 '--build-properties=%s' % json.dumps(options.build_properties)] |
79 | 79 |
80 | 80 |
81 def RunSteps(all_steps, options): | 81 def RunSteps(steps, step_cmds, options): |
82 if not options.steps: | 82 unknown_steps = set(steps) - set(step for step, _ in step_cmds) |
83 return | |
84 | |
85 steps = options.steps.split(',') | |
86 unknown_steps = set(steps) - set(step for step, _ in all_steps) | |
87 if unknown_steps: | 83 if unknown_steps: |
88 print >> sys.stderr, 'FATAL: Unknown steps %s' % list(unknown_steps) | 84 print >> sys.stderr, 'FATAL: Unknown steps %s' % list(unknown_steps) |
89 sys.exit(1) | 85 sys.exit(1) |
90 | 86 |
91 for step, cmd in all_steps: | 87 for step, cmd in step_cmds: |
92 if step in steps: | 88 if step in steps: |
93 cmd(options) | 89 cmd(options) |
90 | |
91 | |
92 def RunAllSteps(step_cmds, options): | |
Isaac (away)
2013/06/29 09:55:39
I think this would be better to keep this code inl
Siva Chandra
2013/07/01 23:58:53
Done.
| |
93 for _, cmd in step_cmds: | |
94 cmd(options) | |
OLD | NEW |