Chromium Code Reviews| Index: scripts/slave/recipe_universe.py |
| diff --git a/scripts/slave/recipe_universe.py b/scripts/slave/recipe_universe.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ae5501312cb70f40184d57af82ef2e7a7b71b24b |
| --- /dev/null |
| +++ b/scripts/slave/recipe_universe.py |
| @@ -0,0 +1,27 @@ |
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
|
iannucci
2015/05/27 02:03:27
time happened
luqui
2015/05/28 21:47:38
Acknowledged.
|
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import os |
| +import sys |
| + |
| +BUILD_ROOT = os.path.dirname(os.path.dirname(os.path.dirname( |
| + os.path.abspath(__file__)))) |
| +BUILD_INTERNAL_ROOT = os.path.join( |
| + os.path.dirname(BUILD_ROOT), 'build_internal') |
| + |
| +sys.path.append(os.path.join(BUILD_ROOT, 'third_party')) |
| + |
| +_UNIVERSE = None |
| +def get_universe(): |
| + from recipe_engine import recipe_loader |
| + global _UNIVERSE |
| + if _UNIVERSE is None: |
| + roots = [BUILD_ROOT, BUILD_INTERNAL_ROOT] |
| + _UNIVERSE = recipe_loader.RecipeUniverse( |
| + module_dirs=[ os.path.join(root, 'scripts', 'slave', 'recipe_modules') |
| + for root in roots ], |
| + recipe_dirs=[ os.path.join(root, 'scripts', 'slave', 'recipes') |
| + for root in roots ]) |
| + return _UNIVERSE |
| + |