Bug 1319637 - Transform ObjDir*Files into FinalTarget*Files. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 23 Nov 2016 11:51:09 +0900
changeset 323959 b4822cdc2dfeef9e03c58f6d138568b60dc130bb
parent 323958 b5979faeba28d66d09b73e127c5ff6ffee5ccf10
child 323960 535f8682016bdc71be4d604bdf61c9247ca47feb
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersgps
bugs1319637
milestone53.0a1
Bug 1319637 - Transform ObjDir*Files into FinalTarget*Files. r=gps While the recursive make backend needs to handle ObjDir*Files separately for now, other backends can handle them just as FinalTarget*Files instead, simplifying their implementation.
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/data.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -586,28 +586,28 @@ class RecursiveMakeBackend(CommonBackend
         elif isinstance(obj, StaticLibrary):
             self._process_static_library(obj, backend_file)
             self._process_linked_libraries(obj, backend_file)
 
         elif isinstance(obj, HostLibrary):
             self._process_host_library(obj, backend_file)
             self._process_linked_libraries(obj, backend_file)
 
+        elif isinstance(obj, ObjdirFiles):
+            self._process_objdir_files(obj, obj.files, backend_file)
+
+        elif isinstance(obj, ObjdirPreprocessedFiles):
+            self._process_final_target_pp_files(obj, obj.files, backend_file, 'OBJDIR_PP_FILES')
+
         elif isinstance(obj, FinalTargetFiles):
             self._process_final_target_files(obj, obj.files, backend_file)
 
         elif isinstance(obj, FinalTargetPreprocessedFiles):
             self._process_final_target_pp_files(obj, obj.files, backend_file, 'DIST_FILES')
 
-        elif isinstance(obj, ObjdirFiles):
-            self._process_objdir_files(obj, obj.files, backend_file)
-
-        elif isinstance(obj, ObjdirPreprocessedFiles):
-            self._process_final_target_pp_files(obj, obj.files, backend_file, 'OBJDIR_PP_FILES')
-
         elif isinstance(obj, AndroidResDirs):
             # Order matters.
             for p in obj.paths:
                 backend_file.write('ANDROID_RES_DIRS += %s\n' % p.full_path)
 
         elif isinstance(obj, AndroidAssetsDirs):
             # Order matters.
             for p in obj.paths:
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -886,41 +886,29 @@ class FinalTargetPreprocessedFiles(Conte
     """
     __slots__ = ('files')
 
     def __init__(self, sandbox, files):
         ContextDerived.__init__(self, sandbox)
         self.files = files
 
 
-class ObjdirFiles(ContextDerived):
+class ObjdirFiles(FinalTargetFiles):
     """Sandbox container object for OBJDIR_FILES, which is a
     HierarchicalStringList.
     """
-    __slots__ = ('files')
-
-    def __init__(self, sandbox, files):
-        ContextDerived.__init__(self, sandbox)
-        self.files = files
-
     @property
     def install_target(self):
         return ''
 
 
-class ObjdirPreprocessedFiles(ContextDerived):
+class ObjdirPreprocessedFiles(FinalTargetPreprocessedFiles):
     """Sandbox container object for OBJDIR_PP_FILES, which is a
     HierarchicalStringList.
     """
-    __slots__ = ('files')
-
-    def __init__(self, sandbox, files):
-        ContextDerived.__init__(self, sandbox)
-        self.files = files
-
     @property
     def install_target(self):
         return ''
 
 
 class TestHarnessFiles(FinalTargetFiles):
     """Sandbox container object for TEST_HARNESS_FILES,
     which is a HierarchicalStringList.