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

Side by Side Diff: scripts/slave/recipe_api.py

Issue 1111413005: Some changes to allow recipes and modules to live noncentrally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Review comments Created 5 years, 7 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 | « scripts/slave/annotated_run.py ('k') | scripts/slave/recipe_config_types.py » ('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 import contextlib 5 import contextlib
6 import types 6 import types
7 7
8 from functools import wraps 8 from functools import wraps
9 9
10 from .recipe_test_api import DisabledTestData, ModuleTestData 10 from .recipe_test_api import DisabledTestData, ModuleTestData
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 """Sets the modules and its dependencies to the named configuration.""" 364 """Sets the modules and its dependencies to the named configuration."""
365 assert self._module 365 assert self._module
366 config, params = self.make_config_params(config_name, optional, 366 config, params = self.make_config_params(config_name, optional,
367 **CONFIG_VARS) 367 **CONFIG_VARS)
368 if config: 368 if config:
369 self.c = config 369 self.c = config
370 370
371 if include_deps: 371 if include_deps:
372 # TODO(iannucci): This is 'inefficient', since if a dep comes up multiple 372 # TODO(iannucci): This is 'inefficient', since if a dep comes up multiple
373 # times in this recursion, it will get set_config()'d multiple times 373 # times in this recursion, it will get set_config()'d multiple times
374 for dep in self._module.DEPS: 374 for dep in self._module.LOADED_DEPS:
375 getattr(self.m, dep).set_config(config_name, optional=True, **params) 375 getattr(self.m, dep).set_config(config_name, optional=True, **params)
376 376
377 def apply_config(self, config_name, config_object=None): 377 def apply_config(self, config_name, config_object=None):
378 """Apply a named configuration to the provided config object or self.""" 378 """Apply a named configuration to the provided config object or self."""
379 self._module.CONFIG_CTX.CONFIG_ITEMS[config_name](config_object or self.c) 379 self._module.CONFIG_CTX.CONFIG_ITEMS[config_name](config_object or self.c)
380 380
381 def resource(self, *path): 381 def resource(self, *path):
382 """Returns path to a file under <recipe module>/resources/ directory. 382 """Returns path to a file under <recipe module>/resources/ directory.
383 383
384 Args: 384 Args:
385 path: path relative to module's resources/ directory. 385 path: path relative to module's resources/ directory.
386 """ 386 """
387 # TODO(vadimsh): Verify that file exists. Including a case like: 387 # TODO(vadimsh): Verify that file exists. Including a case like:
388 # module.resource('dir').join('subdir', 'file.py') 388 # module.resource('dir').join('subdir', 'file.py')
389 return self._module.MODULE_DIRECTORY.join('resources', *path) 389 return self._module.MODULE_DIRECTORY.join('resources', *path)
390 390
391 @property 391 @property
392 def name(self): 392 def name(self):
393 return self._module.NAME 393 return self._module.NAME
394 394
395 395
396 class RecipeApi(RecipeApiPlain): 396 class RecipeApi(RecipeApiPlain):
397 __metaclass__ = RecipeApiMeta 397 __metaclass__ = RecipeApiMeta
OLDNEW
« no previous file with comments | « scripts/slave/annotated_run.py ('k') | scripts/slave/recipe_config_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698