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

Unified Diff: tools/cr/cr/commands/prepare.py

Issue 1095613002: cr: Add support for GN build file generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits addressed. Created 5 years, 8 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/commands/init.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/commands/prepare.py
diff --git a/tools/cr/cr/commands/prepare.py b/tools/cr/cr/commands/prepare.py
index ba3956ab9eb30b276544fdba918417b234bd530f..7a70bcb851502bbcce860b3576c66d2bac7a3def 100644
--- a/tools/cr/cr/commands/prepare.py
+++ b/tools/cr/cr/commands/prepare.py
@@ -31,14 +31,12 @@ class PrepareCommand(cr.Command):
@classmethod
def UpdateContext(cls):
- for preparation in PrepareOut.Plugins():
- preparation.UpdateContext()
+ PrepareOut.GetActivePlugin().UpdateContext()
@classmethod
def Prepare(cls):
cls.UpdateContext()
- for preparation in PrepareOut.Plugins():
- preparation.Prepare()
+ PrepareOut.GetActivePlugin().Prepare()
class PrepareOut(cr.Plugin, cr.Plugin.Type):
@@ -47,6 +45,18 @@ class PrepareOut(cr.Plugin, cr.Plugin.Type):
See PrepareCommand for details.
"""
+ SELECTOR = 'CR_GENERATOR'
+
+ @classmethod
+ def AddArguments(cls, parser):
+ parser.add_argument(
+ '--generator', dest=cls.SELECTOR,
+ choices=cls.Choices(),
+ default=None,
+ help=('Sets the build file generator to use. ' +
+ 'Overrides %s.' % cls.SELECTOR)
+ )
+
def UpdateContext(self):
"""Update the context if needed.
« no previous file with comments | « tools/cr/cr/commands/init.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698