From 5657bb3c0f8e20b2e79a831c5e6cf99fccab1fd7 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Thu, 5 Sep 2013 11:20:02 -0400 Subject: [PATCH] Bug 912197 - part 4 - write out lists of WebIDL source files for dom/bindings/; r=gps --- .../mozbuild/backend/recursivemake.py | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index eaeb1ae5f1d7..b96147e5fd6f 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -20,14 +20,18 @@ from .common import CommonBackend from ..frontend.data import ( ConfigFileSubstitution, DirectoryTraversal, + Exports, + GeneratedWebIDLFile, IPDLFile, LocalInclude, - SandboxDerived, - VariablePassthru, - Exports, + PreprocessedWebIDLFile, Program, + SandboxDerived, + TestWebIDLFile, + VariablePassthru, XPIDLFile, XpcshellManifests, + WebIDLFile, ) from ..util import FileAvoidWrite @@ -122,6 +126,10 @@ class RecursiveMakeBackend(CommonBackend): 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( @@ -199,6 +207,21 @@ class RecursiveMakeBackend(CommonBackend): 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) @@ -272,6 +295,22 @@ class RecursiveMakeBackend(CommonBackend): 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,