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 contextlib | 5 import contextlib |
6 import datetime | 6 import datetime |
7 import json | 7 import json |
8 import os | 8 import os |
9 import re | 9 import re |
10 import urllib | 10 import urllib |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 self.m.python( | 87 self.m.python( |
88 step_name, | 88 step_name, |
89 str(self.m.path['build'].join( | 89 str(self.m.path['build'].join( |
90 'scripts', 'slave', 'android', 'archive_build.py')), | 90 'scripts', 'slave', 'android', 'archive_build.py')), |
91 archive_args, | 91 archive_args, |
92 infra_step=True, | 92 infra_step=True, |
93 **kwargs | 93 **kwargs |
94 ) | 94 ) |
95 | 95 |
96 def init_and_sync(self, gclient_config='android_bare', | 96 def init_and_sync(self, gclient_config='android_bare', |
97 with_branch_heads=False): | 97 with_branch_heads=False, use_bot_update=True): |
98 # TODO(sivachandra): Move the setting of the gclient spec below to an | 98 # TODO(sivachandra): Move the setting of the gclient spec below to an |
99 # internal config extension when they are supported by the recipe system. | 99 # internal config extension when they are supported by the recipe system. |
100 spec = self.m.gclient.make_config(gclient_config) | 100 spec = self.m.gclient.make_config(gclient_config) |
101 spec.target_os = ['android'] | 101 spec.target_os = ['android'] |
102 s = spec.solutions[0] | 102 s = spec.solutions[0] |
103 s.name = self.c.deps_dir | 103 s.name = self.c.deps_dir |
104 s.url = self.c.REPO_URL | 104 s.url = self.c.REPO_URL |
105 s.custom_deps = self.c.gclient_custom_deps or {} | 105 s.custom_deps = self.c.gclient_custom_deps or {} |
106 s.deps_file = self.c.deps_file | 106 s.deps_file = self.c.deps_file |
107 s.custom_vars = self.c.gclient_custom_vars or {} | 107 s.custom_vars = self.c.gclient_custom_vars or {} |
108 s.managed = self.c.managed | 108 s.managed = self.c.managed |
109 s.revision = self.c.revision | 109 s.revision = self.c.revision |
110 spec.revisions = self.c.revisions | 110 spec.revisions = self.c.revisions |
111 | 111 |
112 self.m.gclient.break_locks() | 112 self.m.gclient.break_locks() |
113 refs = self.m.properties.get('event.patchSet.ref') | 113 refs = self.m.properties.get('event.patchSet.ref') |
114 if refs: | 114 if refs: |
115 refs = [refs] | 115 refs = [refs] |
116 result = self.m.bot_update.ensure_checkout( | 116 if use_bot_update: |
117 spec, refs=refs, with_branch_heads=with_branch_heads) | 117 result = self.m.bot_update.ensure_checkout( |
118 if not result.json.output['did_run']: | 118 spec, refs=refs, with_branch_heads=with_branch_heads) |
| 119 else: |
119 result = self.m.gclient.checkout(spec, with_branch_heads=with_branch_heads
) | 120 result = self.m.gclient.checkout(spec, with_branch_heads=with_branch_heads
) |
120 | 121 |
121 # TODO(sivachandra): Manufacture gclient spec such that it contains "src" | 122 # TODO(sivachandra): Manufacture gclient spec such that it contains "src" |
122 # solution + repo_name solution. Then checkout will be automatically | 123 # solution + repo_name solution. Then checkout will be automatically |
123 # correctly set by gclient.checkout | 124 # correctly set by gclient.checkout |
124 self.m.path['checkout'] = self.m.path['slave_build'].join('src') | 125 self.m.path['checkout'] = self.m.path['slave_build'].join('src') |
125 | 126 |
126 self.clean_local_files() | 127 self.clean_local_files() |
127 | 128 |
128 return result | 129 return result |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 def test_runner(self, step_name, args=None, **kwargs): | 1228 def test_runner(self, step_name, args=None, **kwargs): |
1228 """Wrapper for the python testrunner script. | 1229 """Wrapper for the python testrunner script. |
1229 | 1230 |
1230 Args: | 1231 Args: |
1231 step_name: Name of the step. | 1232 step_name: Name of the step. |
1232 args: Testrunner arguments. | 1233 args: Testrunner arguments. |
1233 """ | 1234 """ |
1234 with self.handle_exit_codes(): | 1235 with self.handle_exit_codes(): |
1235 return self.m.python( | 1236 return self.m.python( |
1236 step_name, self.c.test_runner, args, **kwargs) | 1237 step_name, self.c.test_runner, args, **kwargs) |
OLD | NEW |