]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Support more file types in build cache
authorShi, Steven <steven.shi@intel.com>
Tue, 27 Aug 2019 05:16:46 +0000 (13:16 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 2 Sep 2019 04:17:56 +0000 (12:17 +0800)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1958

Current build cache does not store and restore all
types file of Hii/vfr, version and dpx. This patch
adds more file types to support them in build cache.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/ModuleAutoGen.py

index f610365f6dee5c3f248c8cf18afe982b8626c3b2..3bb7e91154acbe7deeae88f84ceab832b2b43d63 100755 (executable)
@@ -1267,29 +1267,30 @@ class ModuleAutoGen(AutoGen):
     @cached_property\r
     def OutputFile(self):\r
         retVal = set()\r
+\r
         OutputDir = self.OutputDir.replace('\\', '/').strip('/')\r
         DebugDir = self.DebugDir.replace('\\', '/').strip('/')\r
-        FfsOutputDir = self.FfsOutputDir.replace('\\', '/').rstrip('/')\r
         for Item in self.CodaTargetList:\r
             File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')\r
-            retVal.add(File)\r
-        if self.DepexGenerated:\r
-            retVal.add(self.Name + '.depex')\r
+            NewFile = path.join(self.OutputDir, File)\r
+            retVal.add(NewFile)\r
 \r
         Bin = self._GenOffsetBin()\r
         if Bin:\r
-            retVal.add(Bin)\r
+            NewFile = path.join(self.OutputDir, Bin)\r
+            retVal.add(NewFile)\r
 \r
-        for Root, Dirs, Files in os.walk(OutputDir):\r
+        for Root, Dirs, Files in os.walk(self.OutputDir):\r
             for File in Files:\r
-                if File.lower().endswith('.pdb'):\r
-                    retVal.add(File)\r
+                # lib file is already added through above CodaTargetList, skip it here\r
+                if not (File.lower().endswith('.obj') or File.lower().endswith('.lib')):\r
+                    NewFile = path.join(self.OutputDir, File)\r
+                    retVal.add(NewFile)\r
 \r
-        for Root, Dirs, Files in os.walk(FfsOutputDir):\r
+        for Root, Dirs, Files in os.walk(self.FfsOutputDir):\r
             for File in Files:\r
-                if File.lower().endswith('.ffs') or File.lower().endswith('.offset') or File.lower().endswith('.raw') \\r
-                    or File.lower().endswith('.raw.txt'):\r
-                    retVal.add(File)\r
+                NewFile = path.join(self.FfsOutputDir, File)\r
+                retVal.add(NewFile)\r
 \r
         return retVal\r
 \r
@@ -1659,15 +1660,8 @@ class ModuleAutoGen(AutoGen):
             Ma = self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain]\r
             self.OutputFile = Ma.Binaries\r
         for File in self.OutputFile:\r
-            File = str(File)\r
-            if not os.path.isabs(File):\r
-                NewFile = os.path.join(self.OutputDir, File)\r
-                if not os.path.exists(NewFile):\r
-                    NewFile = os.path.join(self.FfsOutputDir, File)\r
-                File = NewFile\r
             if os.path.exists(File):\r
-                if File.lower().endswith('.ffs') or File.lower().endswith('.offset') or File.lower().endswith('.raw') \\r
-                    or File.lower().endswith('.raw.txt'):\r
+                if File.startswith(os.path.abspath(self.FfsOutputDir)+os.sep):\r
                     self.CacheCopyFile(FfsDir, self.FfsOutputDir, File)\r
                 else:\r
                     self.CacheCopyFile(FileDir, self.OutputDir, File)\r