presubmit: add depot_tools to PATH

BUG=584197

Review URL: https://codereview.chromium.org/1665233002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298599 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
phajdan.jr@chromium.org
2016-02-04 21:29:59 +00:00
parent a40e355ad2
commit 821e0a5db8
3 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
DEPS = [
'recipe_engine/path',
'recipe_engine/python',
]

View File

@@ -7,7 +7,14 @@ from recipe_engine import recipe_api
class PresubmitApi(recipe_api.RecipeApi):
def __call__(self, *args, **kwargs):
"""Return a presubmit step."""
name = kwargs.pop('name', 'presubmit')
kwargs.setdefault('env', {})
kwargs['env'].setdefault('PATH', '%(PATH)s')
kwargs['env']['PATH'] = self.m.path.pathsep.join([
kwargs['env']['PATH'], str(self._module.PACKAGE_DIRECTORY)])
return self.m.python(
name, self.package_resource('presubmit_support.py'), list(args),
**kwargs)

View File

@@ -6,6 +6,9 @@
"RECIPE_PACKAGE[depot_tools]/presubmit_support.py"
],
"cwd": "[SLAVE_BUILD]",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]"
},
"name": "presubmit"
},
{