Bug 928195 - Part 4: mach command for generating WebIDL example files; r=froydnj
authorGregory Szorc <gps@mozilla.com>
Thu, 14 Nov 2013 10:34:55 -0800
changeset 156408 afc54efcf0fd4bd51a61566d2ba11fcbac9a5451
parent 156407 c0e8f2c0465f8954f5516c63f63095706d432d59
child 156409 b6f5dfa97f98c8385e86b71a748776fc7a2b4775
push id25678
push userryanvm@gmail.com
push dateWed, 20 Nov 2013 03:26:13 +0000
treeherdermozilla-central@4f993fa378eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs928195
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 928195 - Part 4: mach command for generating WebIDL example files; r=froydnj
dom/bindings/mach_commands.py
--- a/dom/bindings/mach_commands.py
+++ b/dom/bindings/mach_commands.py
@@ -13,16 +13,27 @@ from mach.decorators import (
     Command,
 )
 
 from mozbuild.base import MachCommandBase
 
 
 @CommandProvider
 class WebIDLProvider(MachCommandBase):
+    @Command('webidl-example', category='misc',
+        description='Generate example files for a WebIDL interface.')
+    @CommandArgument('interface', nargs='+',
+        help='Interface(s) whose examples to generate.')
+    def webidl_example(self, interface):
+        from mozwebidl import BuildSystemWebIDL
+
+        manager = self._spawn(BuildSystemWebIDL).manager
+        for i in interface:
+            manager.generate_example_files(i)
+
     @Command('webidl-parser-test', category='testing',
         description='Run WebIDL tests.')
     @CommandArgument('--verbose', '-v', action='store_true',
         help='Run tests in verbose mode.')
     def webidl_test(self, verbose=False):
         sys.path.insert(0, os.path.join(self.topsrcdir, 'other-licenses',
             'ply'))