OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import collections | 7 import collections |
8 import copy | 8 import copy |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 27 matching lines...) Expand all Loading... |
38 def DictDiff(d1, d2): | 38 def DictDiff(d1, d2): |
39 diff = [] | 39 diff = [] |
40 for key in sorted(set(d1.keys() + d2.keys())): | 40 for key in sorted(set(d1.keys() + d2.keys())): |
41 if key in d1 and d1[key] != d2.get(key): | 41 if key in d1 and d1[key] != d2.get(key): |
42 diff.append('- %s=%s' % (key, pipes.quote(d1[key]))) | 42 diff.append('- %s=%s' % (key, pipes.quote(d1[key]))) |
43 if key in d2 and d2[key] != d1.get(key): | 43 if key in d2 and d2[key] != d1.get(key): |
44 diff.append('+ %s=%s' % (key, pipes.quote(d2[key]))) | 44 diff.append('+ %s=%s' % (key, pipes.quote(d2[key]))) |
45 return '\n'.join(diff) | 45 return '\n'.join(diff) |
46 | 46 |
47 | 47 |
48 def GetEnvironment(host_obj, testing): | 48 def GetEnvironment(host_obj, testing, extra_env_vars=None): |
49 init_env = dict(os.environ) | 49 init_env = dict(os.environ) |
50 init_env['GYP_GENERATORS'] = 'ninja' | 50 init_env['GYP_GENERATORS'] = 'ninja' |
51 init_env['GOMA_DIR'] = bb_utils.GOMA_DIR | 51 init_env['GOMA_DIR'] = bb_utils.GOMA_DIR |
| 52 if extra_env_vars: |
| 53 init_env.update(extra_env_vars) |
52 envsetup_cmd = '. build/android/envsetup.sh' | 54 envsetup_cmd = '. build/android/envsetup.sh' |
53 if host_obj.target_arch: | 55 if host_obj.target_arch: |
54 envsetup_cmd += ' --target-arch=%s' % host_obj.target_arch | 56 envsetup_cmd += ' --target-arch=%s' % host_obj.target_arch |
55 if testing: | 57 if testing: |
56 # Skip envsetup to avoid presubmit dependence on android deps. | 58 # Skip envsetup to avoid presubmit dependence on android deps. |
57 print 'Testing mode - skipping "%s"' % envsetup_cmd | 59 print 'Testing mode - skipping "%s"' % envsetup_cmd |
58 envsetup_cmd = ':' | 60 envsetup_cmd = ':' |
59 else: | 61 else: |
60 print 'Running %s' % envsetup_cmd | 62 print 'Running %s' % envsetup_cmd |
61 proc = subprocess.Popen(['bash', '-exc', | 63 proc = subprocess.Popen(['bash', '-exc', |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 for command in commands: | 273 for command in commands: |
272 print 'Will run: ', bb_utils.CommandToString(command) | 274 print 'Will run: ', bb_utils.CommandToString(command) |
273 print | 275 print |
274 | 276 |
275 env = GetEnvironment(bot_config.host_obj, options.testing) | 277 env = GetEnvironment(bot_config.host_obj, options.testing) |
276 return RunBotCommands(options, commands, env) | 278 return RunBotCommands(options, commands, env) |
277 | 279 |
278 | 280 |
279 if __name__ == '__main__': | 281 if __name__ == '__main__': |
280 sys.exit(main(sys.argv)) | 282 sys.exit(main(sys.argv)) |
OLD | NEW |