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

Unified Diff: scripts/slave/recipe_modules/goma/example.py

Issue 2480193002: Stop to use contextmanager for goma.build_with_goma (Closed)
Patch Set: use env_update Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/goma/example.py
diff --git a/scripts/slave/recipe_modules/goma/example.py b/scripts/slave/recipe_modules/goma/example.py
index 134b782f3569d6a0942db321f8cd55a2a8ce0e09..93317fc4d4a5a3083432e60fb9585cd813866b86 100644
--- a/scripts/slave/recipe_modules/goma/example.py
+++ b/scripts/slave/recipe_modules/goma/example.py
@@ -26,17 +26,14 @@ def RunSteps(api):
ninja_log_compiler=api.properties.get('ninja_log_compiler'),
ninja_log_command=command,
allow_build_without_goma=allow_build_without_goma,
- env=env):
- if 'GOMA_DISABLED' in env:
- api.goma.remove_j_flag(command)
- api.step('ninja', command, env=env)
- else:
- # build something using goma.
- api.step('echo goma jobs',
- ['echo', str(api.goma.recommended_goma_jobs)])
- api.step('echo goma jobs second',
- ['echo', str(api.goma.recommended_goma_jobs)])
- api.step('ninja', command, env=env)
+ env=env) as (env_update, ninja_command):
+ env.update(env_update)
+ # build something using goma.
+ api.step('echo goma jobs',
+ ['echo', str(api.goma.recommended_goma_jobs)])
+ api.step('echo goma jobs second',
+ ['echo', str(api.goma.recommended_goma_jobs)])
+ api.step('ninja', ninja_command, env=env)
def GenTests(api):
for platform in ('linux', 'win', 'mac'):

Powered by Google App Engine
This is Rietveld 408576698