Bug 884587 - Part 2: Add EXPORTS files to purge manifest; r=glandium
☠☠ backed out by ff579fc118dd ☠ ☠
authorGregory Szorc <gps@mozilla.com>
Tue, 25 Jun 2013 11:04:06 -0700
changeset 144015 447ff64adbb1e831302f959b8515bacb384e0089
parent 144014 8d90527c22c60c38ea3492bf67d53dd47455c082
child 144016 61102ea334c70a75074e30484ee6ccbad9c3a498
push idunknown
push userunknown
push dateunknown
reviewersglandium
bugs884587
milestone25.0a1
Bug 884587 - Part 2: Add EXPORTS files to purge manifest; r=glandium
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -318,16 +318,20 @@ class RecursiveMakeBackend(BuildBackend)
         else:
             export_name = 'EXPORTS'
 
         # Iterate over the list of export filenames, printing out an EXPORTS
         # declaration for each.
         if strings:
             backend_file.write('%s += %s\n' % (export_name, ' '.join(strings)))
 
+            for s in strings:
+                p = '%s%s' % (namespace, s)
+                self._purge_manifests['dist_include'].add(p)
+
         children = exports.get_children()
         for subdir in sorted(children):
             self._process_exports(children[subdir], backend_file,
                                   namespace=namespace + subdir)
 
     def _process_program(self, program, backend_file):
         backend_file.write('PROGRAM = %s\n' % program)
 
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -226,16 +226,23 @@ class TestRecursiveMakeBackend(BackendTe
             'EXPORTS_NAMESPACES += mozilla/dom',
             'EXPORTS_mozilla/dom += dom1.h dom2.h',
             'EXPORTS_NAMESPACES += mozilla/gfx',
             'EXPORTS_mozilla/gfx += gfx.h',
             'EXPORTS_NAMESPACES += nspr/private',
             'EXPORTS_nspr/private += pprio.h',
         ])
 
+        # EXPORTS files should appear in the dist_include purge manifest.
+        m = PurgeManifest.from_path(os.path.join(env.topobjdir,
+            '_purge_manifests', 'dist_include'))
+        self.assertIn('foo.h', m.entries)
+        self.assertIn('mozilla/mozilla1.h', m.entries)
+        self.assertIn('mozilla/dom/dom2.h', m.entries)
+
     def test_xpcshell_manifests(self):
         """Ensure XPCSHELL_TESTS_MANIFESTS is written out correctly."""
         env = self._consume('xpcshell_manifests', RecursiveMakeBackend)
 
         backend_path = os.path.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
 
         # Avoid positional parameter and async related breakage