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 from recipe_engine import recipe_api | 5 from recipe_engine import recipe_api |
6 | 6 |
7 | 7 |
8 class RevisionResolver(object): | 8 class RevisionResolver(object): |
9 """Resolves the revision based on build properties.""" | 9 """Resolves the revision based on build properties.""" |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 self._spec_alias = None | 84 self._spec_alias = None |
85 | 85 |
86 def __call__(self, name, cmd, infra_step=True, **kwargs): | 86 def __call__(self, name, cmd, infra_step=True, **kwargs): |
87 """Wrapper for easy calling of gclient steps.""" | 87 """Wrapper for easy calling of gclient steps.""" |
88 assert isinstance(cmd, (list, tuple)) | 88 assert isinstance(cmd, (list, tuple)) |
89 prefix = 'gclient ' | 89 prefix = 'gclient ' |
90 if self.spec_alias: | 90 if self.spec_alias: |
91 prefix = ('[spec: %s] ' % self.spec_alias) + prefix | 91 prefix = ('[spec: %s] ' % self.spec_alias) + prefix |
92 | 92 |
93 return self.m.python(prefix + name, | 93 return self.m.python(prefix + name, |
94 self.m.path['depot_tools'].join('gclient.py'), | 94 self.package_resource('gclient.py'), |
95 cmd, | 95 cmd, |
96 infra_step=infra_step, | 96 infra_step=infra_step, |
97 **kwargs) | 97 **kwargs) |
98 | 98 |
99 @property | 99 @property |
100 def use_mirror(self): | 100 def use_mirror(self): |
101 """Indicates if gclient will use mirrors in its configuration.""" | 101 """Indicates if gclient will use mirrors in its configuration.""" |
102 if self.USE_MIRROR is None: | 102 if self.USE_MIRROR is None: |
103 self.USE_MIRROR = self.m.properties.get('use_mirror', True) | 103 self.USE_MIRROR = self.m.properties.get('use_mirror', True) |
104 return self.USE_MIRROR | 104 return self.USE_MIRROR |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 for (path, dir, files) in os.walk(build_path): | 317 for (path, dir, files) in os.walk(build_path): |
318 for cur_file in files: | 318 for cur_file in files: |
319 if cur_file.endswith('index.lock'): | 319 if cur_file.endswith('index.lock'): |
320 path_to_file = os.path.join(path, cur_file) | 320 path_to_file = os.path.join(path, cur_file) |
321 print 'deleting %s' % path_to_file | 321 print 'deleting %s' % path_to_file |
322 os.remove(path_to_file) | 322 os.remove(path_to_file) |
323 """, | 323 """, |
324 args=[self.m.path['slave_build']], | 324 args=[self.m.path['slave_build']], |
325 infra_step=True, | 325 infra_step=True, |
326 ) | 326 ) |
OLD | NEW |