Chromium Code Reviews| Index: recipe_engine/run.py |
| diff --git a/recipe_engine/run.py b/recipe_engine/run.py |
| index 2d1b3f3ebfb297c19f9b96b530c5a41123a1df9c..9c94f4d835ee4ac14691607141c8faab5a3997bb 100644 |
| --- a/recipe_engine/run.py |
| +++ b/recipe_engine/run.py |
| @@ -1,4 +1,4 @@ |
| -# Copyright (c) 2013-2015 The Chromium Authors. All rights reserved. |
| +# Copyright (c) 2016 The Chromium Authors. All rights reserved. |
|
martiniss
2016/04/06 00:27:43
The license checker was complaining ¯\_(ツ)_/¯
|
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| @@ -64,6 +64,7 @@ iterable_of_things. |
| """ |
| import collections |
| +import json |
| import os |
| import sys |
| import traceback |
| @@ -179,7 +180,7 @@ ENV_WHITELIST_POSIX = BUILDBOT_MAGIC_ENV | set([ |
| RecipeResult = collections.namedtuple('RecipeResult', 'result') |
| -def run_steps(properties, stream_engine, step_runner, universe): |
| +def run_steps(properties, stream_engine, step_runner, universe_view): |
| """Runs a recipe (given by the 'recipe' property). |
| Args: |
| @@ -187,7 +188,7 @@ def run_steps(properties, stream_engine, step_runner, universe): |
| 'recipe' property defines which recipe to actually run. |
| stream_engine: the StreamEngine to use to create individual step streams. |
| step_runner: The StepRunner to use to 'actually run' the steps. |
| - universe: The RecipeUniverse to use to load the recipes & modules. |
| + universe_view: The RecipeUniverse to use to load the recipes & modules. |
| Returns: RecipeResult |
| """ |
| @@ -205,7 +206,7 @@ def run_steps(properties, stream_engine, step_runner, universe): |
| 'TESTING_SLAVENAME' in os.environ)): |
| properties['use_mirror'] = False |
| - engine = RecipeEngine(step_runner, properties, universe) |
| + engine = RecipeEngine(step_runner, properties, universe_view) |
| # Create all API modules and top level RunSteps function. It doesn't launch |
| # any recipe code yet; RunSteps needs to be called. |
| @@ -218,11 +219,14 @@ def run_steps(properties, stream_engine, step_runner, universe): |
| if 'use_mirror' in properties: |
| del properties_to_print['use_mirror'] |
| + root_package = universe_view.universe.package_deps.root_package |
| run_recipe_help_lines = [ |
| - 'To repro this locally, run the following line from a build checkout:', |
| + 'To repro this locally, run the following line from a %s checkout:' % ( |
| + root_package.name), |
| '', |
| - './scripts/tools/run_recipe.py %s --properties-file - <<EOF' % recipe, |
| - repr(properties_to_print), |
| + '%s run %s --properties-file - <<EOF' % (os.path.join( |
| + '.', root_package.relative_recipes_dir, 'recipes.py'), recipe), |
| + '%s' % json.dumps(properties_to_print), |
| 'EOF', |
| '', |
| 'To run on Windows, you can put the JSON in a file and redirect the', |
| @@ -237,7 +241,7 @@ def run_steps(properties, stream_engine, step_runner, universe): |
| # Find and load the recipe to run. |
| try: |
| - recipe_script = universe.load_recipe(recipe) |
| + recipe_script = universe_view.load_recipe(recipe) |
| s.write_line('Running recipe with %s' % (properties,)) |
| api = loader.create_recipe_api(recipe_script.LOADED_DEPS, |