1. Add feature to support parsing INF file described in FDF file.
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 21 Sep 2007 03:11:47 +0000 (03:11 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 21 Sep 2007 03:11:47 +0000 (03:11 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@746 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/EdkIIWorkspaceBuild.py

index 931502c..a018737 100755 (executable)
@@ -371,12 +371,12 @@ class WorkspaceBuild(object):
     #\r
     # Generate ModuleDatabase\r
     #\r
-    def GenModuleDatabase(self, PcdsSet = {}):\r
+    def GenModuleDatabase(self, PcdsSet = {}, InfList = []):\r
         for Inf in self.InfDatabase.keys():\r
             Module = self.InfDatabase[Inf].Module\r
 \r
             for Arch in self.SupArchList:\r
-                if not self.IsModuleDefinedInPlatform(Inf, Arch):\r
+                if not self.IsModuleDefinedInPlatform(Inf, Arch, InfList):\r
                     continue\r
 \r
                 pb = ModuleBuildClassObject()\r
@@ -503,13 +503,13 @@ class WorkspaceBuild(object):
     #\r
     # Update Libraries Of Platform Database\r
     #\r
-    def UpdateLibrariesOfPlatform(self):\r
+    def UpdateLibrariesOfPlatform(self, InfList = []):\r
         for Arch in self.SupArchList:\r
             PlatformDatabase = self.Build[Arch].PlatformDatabase\r
             for Dsc in PlatformDatabase:\r
                 Platform = PlatformDatabase[Dsc]\r
                 for Inf in Platform.Modules:\r
-                    if not self.IsModuleDefinedInPlatform(Inf, Arch):\r
+                    if not self.IsModuleDefinedInPlatform(Inf, Arch, InfList):\r
                         continue\r
                     Module = self.Build[Arch].ModuleDatabase[NormPath(Inf)]\r
                     if Module.LibraryClass == None or Module.LibraryClass == []:\r
@@ -696,11 +696,13 @@ class WorkspaceBuild(object):
     #\r
     # Generate build database for all arches\r
     #\r
-    def GenBuildDatabase(self, PcdsSet = {}):\r
+    def GenBuildDatabase(self, PcdsSet = {}, InfList = []):\r
+        for InfFile in InfList:\r
+            self.AddToInfDatabase(InfFile)\r
         self.GenPlatformDatabase()\r
         self.GenPackageDatabase()\r
-        self.GenModuleDatabase(PcdsSet)\r
-        self.UpdateLibrariesOfPlatform()\r
+        self.GenModuleDatabase(PcdsSet, InfList)\r
+        self.UpdateLibrariesOfPlatform(InfList)\r
 \r
     #\r
     # Return a full path with workspace dir\r
@@ -946,7 +948,9 @@ class WorkspaceBuild(object):
     #\r
     # Check if the module is defined in <Compentent> of <Platform>\r
     #\r
-    def IsModuleDefinedInPlatform(self, Inf, Arch):\r
+    def IsModuleDefinedInPlatform(self, Inf, Arch, InfList):\r
+        if Inf in InfList:\r
+            return True\r
         Inf = NormPath(Inf)\r
         for Dsc in self.DscDatabase.values():\r
             for LibraryClass in Dsc.Platform.LibraryClasses.LibraryList:\r
@@ -1057,5 +1061,5 @@ if __name__ == '__main__':
     # Nothing to do here. Could do some unit tests.\r
     w = os.getenv('WORKSPACE')\r
     ewb = WorkspaceBuild('Nt32Pkg/Nt32Pkg.dsc', w)\r
-    ewb.GenBuildDatabase({('PcdDevicePathSupportDevicePathFromText, gEfiMdeModulePkgTokenSpaceGuid') : 'KKKKKKKKKKKKKKKKKKKKK'})\r
+    ewb.GenBuildDatabase({('PcdDevicePathSupportDevicePathFromText, gEfiMdeModulePkgTokenSpaceGuid') : 'KKKKKKKKKKKKKKKKKKKKK'}, ['Test.Inf'])\r
     ewb.ShowWorkspaceBuild()\r