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
parent a40e355a
DEPS = [ DEPS = [
'recipe_engine/path',
'recipe_engine/python', 'recipe_engine/python',
] ]
...@@ -7,7 +7,14 @@ from recipe_engine import recipe_api ...@@ -7,7 +7,14 @@ from recipe_engine import recipe_api
class PresubmitApi(recipe_api.RecipeApi): class PresubmitApi(recipe_api.RecipeApi):
def __call__(self, *args, **kwargs): def __call__(self, *args, **kwargs):
"""Return a presubmit step.""" """Return a presubmit step."""
name = kwargs.pop('name', 'presubmit') 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( return self.m.python(
name, self.package_resource('presubmit_support.py'), list(args), name, self.package_resource('presubmit_support.py'), list(args),
**kwargs) **kwargs)
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
"RECIPE_PACKAGE[depot_tools]/presubmit_support.py" "RECIPE_PACKAGE[depot_tools]/presubmit_support.py"
], ],
"cwd": "[SLAVE_BUILD]", "cwd": "[SLAVE_BUILD]",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]"
},
"name": "presubmit" "name": "presubmit"
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment