From c2d0a1f6d22f0c743899d9d98cef41e4a46c5921 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Thu, 8 Jun 2017 10:14:02 +0800 Subject: BaseTools: Enhance the report to not show the empty section Enhance the report to not show the empty section, eg: Module Library Sub-section, if there is nothing in this section, we will not show it in the report. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/build/BuildReport.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'BaseTools/Source/Python/build/BuildReport.py') diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 91d1e93d49..d700d6f810 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -318,9 +318,9 @@ class LibraryReport(object): # @param File The file object for report # def GenerateReport(self, File): - FileWrite(File, gSubSectionStart) - FileWrite(File, TAB_BRG_LIBRARY) if len(self.LibraryList) > 0: + FileWrite(File, gSubSectionStart) + FileWrite(File, TAB_BRG_LIBRARY) FileWrite(File, gSubSectionSep) for LibraryItem in self.LibraryList: LibInfPath = LibraryItem[0] @@ -347,7 +347,7 @@ class LibraryReport(object): else: FileWrite(File, "{%s}" % LibClass) - FileWrite(File, gSubSectionEnd) + FileWrite(File, gSubSectionEnd) ## # Reports dependency expression information @@ -411,9 +411,6 @@ class DepexReport(object): # def GenerateReport(self, File, GlobalDepexParser): if not self.Depex: - FileWrite(File, gSubSectionStart) - FileWrite(File, TAB_DEPEX) - FileWrite(File, gSubSectionEnd) return FileWrite(File, gSubSectionStart) if os.path.isfile(self._DepexFileName): @@ -866,7 +863,7 @@ class PcdReport(object): FileWrite(File, " *M - Module scoped PCD override") FileWrite(File, gSectionSep) else: - if not ReportSubType: + if not ReportSubType and ModulePcdSet: # # For module PCD sub-section # @@ -1011,7 +1008,7 @@ class PcdReport(object): if ModulePcdSet == None: FileWrite(File, gSectionEnd) else: - if not ReportSubType: + if not ReportSubType and ModulePcdSet: FileWrite(File, gSubSectionEnd) -- cgit v1.2.3