Enhance build report to report module information for single module build.
authorqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Wed, 3 Mar 2010 02:01:51 +0000 (02:01 +0000)
committerqhuang8 <qhuang8@c2973edb-eda0-4c78-bc6a-9341b269661f>
Wed, 3 Mar 2010 02:01:51 +0000 (02:01 +0000)
git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1908 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/Python/build/BuildReport.py
Source/Python/build/build.py

index 59b097a..f83285e 100755 (executable)
@@ -1283,8 +1283,9 @@ class PlatformReport(object):
     #
     # @param self            The object pointer
     # @param Wa              Workspace context information
+    # @param MaList          The list of modules in the platform build
     #
-    def __init__(self, Wa, ReportType):
+    def __init__(self, Wa, MaList, ReportType):
         self._WorkspaceDir = Wa.WorkspaceDir
         self.PlatformName = Wa.Name
         self.PlatformDscPath = Wa.Platform
@@ -1299,7 +1300,7 @@ class PlatformReport(object):
             self.PcdReport = PcdReport(Wa)
 
         self.FdReportList = []
-        if "FLASH" in ReportType and Wa.FdfProfile:
+        if "FLASH" in ReportType and Wa.FdfProfile and MaList == None:
             for Fd in Wa.FdfProfile.FdDict:
                 self.FdReportList.append(FdReport(Wa.FdfProfile.FdDict[Fd], Wa))
 
@@ -1308,9 +1309,13 @@ class PlatformReport(object):
             self.PredictionReport = PredictionReport(Wa)
 
         self.ModuleReportList = []
-        for Pa in Wa.AutoGenObjectList:
-            for ModuleKey in Pa.Platform.Modules:
-                self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[ModuleKey].M, ReportType))
+        if MaList != None:
+            for Ma in MaList:
+                self.ModuleReportList.append(ModuleReport(Ma, ReportType))
+        else:
+            for Pa in Wa.AutoGenObjectList:
+                for ModuleKey in Pa.Platform.Modules:
+                    self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[ModuleKey].M, ReportType))
 
 
 
@@ -1386,10 +1391,11 @@ class BuildReport(object):
     #
     # @param self            The object pointer
     # @param Wa              Workspace context information
+    # @param MaList          The list of modules in the platform build
     #
-    def AddPlatformReport(self, Wa):
+    def AddPlatformReport(self, Wa, MaList=None):
         if self.ReportFile:
-            self.ReportList.append(Wa)
+            self.ReportList.append((Wa, MaList))
 
     ##
     # Generates the final report.
@@ -1407,8 +1413,8 @@ class BuildReport(object):
             except IOError:
                 EdkLogger.error(None, FILE_OPEN_FAILURE, ExtraData=self.ReportFile)
             try:
-                for Wa in self.ReportList:
-                    PlatformReport(Wa, self.ReportType).GenerateReport(File, BuildDuration, self.ReportType)
+                for (Wa, MaList) in self.ReportList:
+                    PlatformReport(Wa, MaList, self.ReportType).GenerateReport(File, BuildDuration, self.ReportType)
                 EdkLogger.quiet("Report successfully saved to %s" % os.path.abspath(self.ReportFile))
             except IOError:
                 EdkLogger.error(None, FILE_WRITE_FAILURE, ExtraData=self.ReportFile)
index 9705097..3075410 100644 (file)
@@ -1336,7 +1336,6 @@ class Build():
                         self.FvList,\r
                         self.SkuId\r
                         )\r
-                self.BuildReport.AddPlatformReport(Wa)\r
                 Wa.CreateMakeFile(False)\r
                 self.Progress.Stop("done!")\r
                 MaList = []\r
@@ -1345,6 +1344,8 @@ class Build():
                     if Ma == None: continue\r
                     MaList.append(Ma)\r
                     self._Build(self.Target, Ma)\r
+\r
+                self.BuildReport.AddPlatformReport(Wa, MaList)\r
                 if MaList == []:\r
                     EdkLogger.error(\r
                                 'build',\r