OLD | NEW |
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 def __call__(self, *args, **kwargs): | 8 def __call__(self, *args, **kwargs): |
9 """Return a presubmit step.""" | 9 """Return a presubmit step.""" |
10 | 10 |
11 name = kwargs.pop('name', 'presubmit') | 11 name = kwargs.pop('name', 'presubmit') |
12 | 12 |
13 kwargs.setdefault('env', {}) | 13 kwargs.setdefault('env', {}) |
14 kwargs['env'].setdefault('PATH', '%(PATH)s') | 14 kwargs['env'].setdefault('PATH', '%(PATH)s') |
15 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | 15 kwargs['env']['PATH'] = self.m.path.pathsep.join([ |
16 kwargs['env']['PATH'], str(self._module.PACKAGE_DIRECTORY)]) | 16 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) |
17 | 17 |
18 return self.m.python( | 18 return self.m.python( |
19 name, self.package_resource('presubmit_support.py'), list(args), | 19 name, self.package_repo_resource('presubmit_support.py'), list(args), |
20 **kwargs) | 20 **kwargs) |
OLD | NEW |