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

Side by Side Diff: recipe_modules/gclient/api.py

Issue 1673603002: depot_tools: use package_resource to locate gclient.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 10 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 | recipe_modules/gclient/example.expected/basic.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 )
OLDNEW
« no previous file with comments | « no previous file | recipe_modules/gclient/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698