Bug 912197 - part 4 - write out lists of WebIDL source files for dom/bindings/; r=gps
authorNathan Froyd <froydnj@mozilla.com>
Thu, 05 Sep 2013 11:20:02 -0400
changeset 146421 5b8391be568d48b5e8633977a8cf936ebf4945fe
parent 146420 91ba20da3b79909dd5c8130a37517c6d9ab9eb88
child 146422 e90fe3a1e259297b94bfcc63dee64dca574b50f2
push id25260
push userryanvm@gmail.com
push dateWed, 11 Sep 2013 00:29:30 +0000
treeherdermozilla-central@f73bed2856a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs912197
milestone26.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 912197 - part 4 - write out lists of WebIDL source files for dom/bindings/; r=gps
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -15,24 +15,28 @@ from mozpack.manifests import (
     PurgeManifest,
 )
 import mozpack.path as mozpath
 
 from .common import CommonBackend
 from ..frontend.data import (
     ConfigFileSubstitution,
     DirectoryTraversal,
+    Exports,
+    GeneratedWebIDLFile,
     IPDLFile,
     LocalInclude,
+    PreprocessedWebIDLFile,
+    Program,
     SandboxDerived,
+    TestWebIDLFile,
     VariablePassthru,
-    Exports,
-    Program,
     XPIDLFile,
     XpcshellManifests,
+    WebIDLFile,
 )
 from ..util import FileAvoidWrite
 
 
 class BackendMakeFile(object):
     """Represents a generated backend.mk file.
 
     This is both a wrapper around a file handle as well as a container that
@@ -117,16 +121,20 @@ class RecursiveMakeBackend(CommonBackend
     recursive make and thus will need this backend.
     """
 
     def _init(self):
         CommonBackend._init(self)
 
         self._backend_files = {}
         self._ipdl_sources = set()
+        self._webidl_sources = set()
+        self._test_webidl_sources = set()
+        self._preprocessed_webidl_sources = set()
+        self._generated_webidl_sources = set()
 
         def detailed(summary):
             return '{:d} total backend files. {:d} created; {:d} updated; {:d} unchanged'.format(
                 summary.managed_count, summary.created_count,
                 summary.updated_count, summary.unchanged_count)
 
         # This is a little kludgy and could be improved with a better API.
         self.summary.backend_detailed_summary = types.MethodType(detailed,
@@ -194,16 +202,31 @@ class RecursiveMakeBackend(CommonBackend
                 else:
                     backend_file.write('%s := %s\n' % (k, v))
         elif isinstance(obj, Exports):
             self._process_exports(obj, obj.exports, backend_file)
 
         elif isinstance(obj, IPDLFile):
             self._ipdl_sources.add(mozpath.join(obj.srcdir, obj.basename))
 
+        elif isinstance(obj, WebIDLFile):
+            self._webidl_sources.add(mozpath.join(obj.srcdir, obj.basename))
+
+        elif isinstance(obj, TestWebIDLFile):
+            self._test_webidl_sources.add(mozpath.join(obj.srcdir,
+                                                       obj.basename))
+
+        elif isinstance(obj, GeneratedWebIDLFile):
+            self._generated_webidl_sources.add(mozpath.join(obj.srcdir,
+                                                            obj.basename))
+
+        elif isinstance(obj, PreprocessedWebIDLFile):
+            self._preprocessed_webidl_sources.add(mozpath.join(obj.srcdir,
+                                                               obj.basename))
+
         elif isinstance(obj, Program):
             self._process_program(obj.program, backend_file)
 
         elif isinstance(obj, XpcshellManifests):
             self._process_xpcshell_manifests(obj, backend_file)
 
         elif isinstance(obj, LocalInclude):
             self._process_local_include(obj.path, backend_file)
@@ -267,16 +290,32 @@ class RecursiveMakeBackend(CommonBackend
                 ipdls.write('CPPSRCS += %sParent.cpp\n' % root)
 
         ipdls.write('IPDLDIRS := %s\n' % ' '.join(sorted(set(os.path.dirname(p)
             for p in self._ipdl_sources))))
 
         self._update_from_avoid_write(ipdls.close())
         self.summary.managed_count += 1
 
+        # Write out master lists of WebIDL source files.
+        webidls = FileAvoidWrite(os.path.join(self.environment.topobjdir,
+              'dom', 'bindings', 'webidlsrcs.mk'))
+
+        for webidl in sorted(self._webidl_sources):
+            webidls.write('webidl_files += %s\n' % os.path.basename(webidl))
+        for webidl in sorted(self._test_webidl_sources):
+            webidls.write('test_webidl_files += %s\n' % os.path.basename(webidl))
+        for webidl in sorted(self._generated_webidl_sources):
+            webidls.write('generated_webidl_files += %s\n' % os.path.basename(webidl))
+        for webidl in sorted(self._preprocessed_webidl_sources):
+            webidls.write('preprocessed_webidl_files += %s\n' % os.path.basename(webidl))
+
+        self._update_from_avoid_write(webidls.close())
+        self.summary.managed_count += 1
+
         # Write out a dependency file used to determine whether a config.status
         # re-run is needed.
         backend_built_path = os.path.join(self.environment.topobjdir,
             'backend.%s.built' % self.__class__.__name__).replace(os.sep, '/')
         backend_deps = FileAvoidWrite('%s.pp' % backend_built_path)
         inputs = sorted(p.replace(os.sep, '/') for p in self.backend_input_files)
 
         # We need to use $(DEPTH) so the target here matches what's in