Chromium Code Reviews| 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..3f98f28d33315f980b21699554cad253d185c529 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. ' + \ |
|
petrcermak
2015/04/17 16:53:14
Again, I think it would be better to use brackets
Sami
2015/04/17 16:57:35
Done.
|
| + 'Overrides %s.' % cls.SELECTOR |
| + ) |
| + |
| def UpdateContext(self): |
| """Update the context if needed. |