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

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

Issue 2045473002: depot_tools: expose paths to presubmit_support.py and upload_to_google_storage.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: presubmit Created 4 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « recipe_modules/depot_tools/example.expected/win.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 class PresubmitApi(recipe_api.RecipeApi): 7 class PresubmitApi(recipe_api.RecipeApi):
8 @property
9 def presubmit_support_path(self):
10 return self.package_repo_resource('presubmit_support.py')
11
8 def __call__(self, *args, **kwargs): 12 def __call__(self, *args, **kwargs):
9 """Return a presubmit step.""" 13 """Return a presubmit step."""
10 14
11 name = kwargs.pop('name', 'presubmit') 15 name = kwargs.pop('name', 'presubmit')
12 16
13 kwargs.setdefault('env', {}) 17 kwargs.setdefault('env', {})
14 kwargs['env'].setdefault('PATH', '%(PATH)s') 18 kwargs['env'].setdefault('PATH', '%(PATH)s')
15 kwargs['env']['PATH'] = self.m.path.pathsep.join([ 19 kwargs['env']['PATH'] = self.m.path.pathsep.join([
16 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) 20 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)])
17 21
18 return self.m.python( 22 return self.m.python(
19 name, self.package_repo_resource('presubmit_support.py'), list(args), 23 name, self.presubmit_support_path, list(args), **kwargs)
20 **kwargs)
OLDNEW
« no previous file with comments | « recipe_modules/depot_tools/example.expected/win.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698