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

Unified Diff: tools/cr/cr/actions/ninja.py

Issue 142933004: [cr tool] Make context implicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/cr/cr/actions/linux.py ('k') | tools/cr/cr/actions/runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/actions/ninja.py
diff --git a/tools/cr/cr/actions/ninja.py b/tools/cr/cr/actions/ninja.py
index afd2d1f9f4b6a1c41eaed634f1c01204f83e6183..dd324f373239ee5530b3c670fd96be7a5af5722d 100644
--- a/tools/cr/cr/actions/ninja.py
+++ b/tools/cr/cr/actions/ninja.py
@@ -34,15 +34,14 @@ class NinjaBuilder(cr.Builder):
super(NinjaBuilder, self).__init__()
self._targets = []
- def Build(self, context, targets, arguments):
+ def Build(self, targets, arguments):
# Make sure Goma is started if Ninja is set to use it.
# This may be redundant, but it currently improves reliability.
try:
- with open(context.Get('NINJA_BUILD_FILE'), 'r') as f:
- if f.readline().rstrip('\n') == context.Get('NINJA_GOMA_LINE'):
+ with open(cr.context.Get('NINJA_BUILD_FILE'), 'r') as f:
+ if f.readline().rstrip('\n') == cr.context.Get('NINJA_GOMA_LINE'):
# Goma is active, so make sure it's started.
cr.Host.ExecuteSilently(
- context,
'{NINJA_GOMA_CTL}',
'ensure_start'
)
@@ -52,7 +51,6 @@ class NinjaBuilder(cr.Builder):
build_arguments = [target.build_target for target in targets]
build_arguments.extend(arguments)
cr.Host.Execute(
- context,
'{NINJA_BINARY}',
'-C{CR_BUILD_DIR}',
'-j{NINJA_JOBS}',
@@ -60,26 +58,24 @@ class NinjaBuilder(cr.Builder):
*build_arguments
)
- def Clean(self, context, targets, arguments):
+ def Clean(self, targets, arguments):
build_arguments = [target.build_target for target in targets]
build_arguments.extend(arguments)
cr.Host.Execute(
- context,
'{NINJA_BINARY}',
'-C{CR_BUILD_DIR}',
'-tclean',
*build_arguments
)
- def GetTargets(self, context):
+ def GetTargets(self):
"""Overridden from Builder.GetTargets."""
if not self._targets:
try:
- context.Get('CR_BUILD_DIR', raise_errors=True)
+ cr.context.Get('CR_BUILD_DIR', raise_errors=True)
except KeyError:
return self._targets
output = cr.Host.Capture(
- context,
'{NINJA_BINARY}',
'-C{CR_BUILD_DIR}',
'-ttargets',
« no previous file with comments | « tools/cr/cr/actions/linux.py ('k') | tools/cr/cr/actions/runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698