git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@466 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 1 Aug 2007 06:51:48 +0000 (06:51 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 1 Aug 2007 06:51:48 +0000 (06:51 +0000)
Source/Python/Common/DecClassObject.py
Source/Python/Common/EdkIIWorkspaceBuild.py
Source/Python/Common/InfClassObject.py

index df7fa38..966ac3a 100644 (file)
@@ -73,7 +73,11 @@ class Dec(DecObject):
             self.DecToPackage()\r
     \r
     def ParseDec(self, Lines, Key, KeyField):\r
-        GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+        newKey = SplitModuleType(Key)\r
+        if newKey[0].find(DataType.TAB_LIBRARY_CLASSES.upper()) != -1:\r
+            GetLibraryClassesWithModuleType(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+        else:\r
+            GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
             \r
     def MergeAllArches(self):\r
         for key in self.KeyList:\r
@@ -188,16 +192,19 @@ class Dec(DecObject):
         LibraryClasses = {}\r
         for Arch in DataType.ARCH_LIST:\r
             for Item in self.Contents[Arch].LibraryClasses:\r
-                List = GetSplitValueList(Item, DataType.TAB_VALUE_SPLIT)\r
+                List = GetSplitValueList(Item[0], DataType.TAB_VALUE_SPLIT)\r
                 if len(List) != 2:\r
                     ErrorMsg = "Wrong statement '%s' found in section LibraryClasses in file '%s', correct format is '<CName>=<GuidValue>'" % (Item, self.Package.Header.FullPath) \r
                     raise ParserError(PARSER_ERROR, msg = ErrorMsg)\r
                 else:\r
-                    MergeArches(LibraryClasses, (List[0], List[1]), Arch)\r
+                    if Item[1] == ['']:\r
+                            Item[1] = DataType.SUP_MODULE_LIST\r
+                    MergeArches(LibraryClasses, (List[0], List[1]) + tuple(Item[1]), Arch)\r
         for Key in LibraryClasses.keys():\r
             LibraryClass = LibraryClassClass()\r
             LibraryClass.LibraryClass = Key[0]\r
             LibraryClass.RecommendedInstance = Key[1]\r
+            LibraryClass.SupModuleList = list(Key[2:])\r
             LibraryClass.SupArchList = LibraryClasses[Key]\r
             self.Package.LibraryClassDeclarations.append(LibraryClass)\r
         \r
@@ -278,7 +285,7 @@ class Dec(DecObject):
             print Item.CName, Item.Guid, Item.SupArchList\r
         print '\nLibraryClasses =', m.LibraryClassDeclarations\r
         for Item in m.LibraryClassDeclarations:\r
-            print Item.LibraryClass, Item.RecommendedInstance, Item.SupArchList\r
+            print Item.LibraryClass, Item.RecommendedInstance, Item.SupModuleList, Item.SupArchList\r
         print '\nPcds =', m.PcdDeclarations\r
         for Item in m.PcdDeclarations:\r
             print Item.CName, Item.TokenSpaceGuidCName, Item.DefaultValue, Item.ItemType, Item.Token, Item.DatumType, Item.SupArchList\r
index 4adb0a7..0a1e98e 100644 (file)
@@ -469,7 +469,7 @@ class WorkspaceBuild(object):
                                 Instance = self.FindLibraryClassInstanceOfLibrary(Lib, Arch, Type)\r
                                 if Instance == None:\r
                                     Instance = RecommendedInstance\r
-                                    pb.LibraryClasses[(Lib, Type)] = NormPath(Instance)\r
+                                pb.LibraryClasses[(Lib, Type)] = NormPath(Instance)\r
                         else:\r
                             # For Module\r
                             Instance = self.FindLibraryClassInstanceOfModule(Lib, Arch, pb.ModuleType, Inf) \r
index e1ed07a..8bbc717 100644 (file)
@@ -265,8 +265,10 @@ class Inf(InfObject):
             LibraryClass.RecommendedInstance = Key[1]\r
             LibraryClass.FeatureFlag = Key[2]\r
             LibraryClass.SupArchList = LibraryClasses[Key]\r
-            if Key[3] != ['']:\r
+            if Key[3] != '':\r
                 LibraryClass.SupModuleList = GetSplitValueList(Key[3])\r
+            else:\r
+                LibraryClass.SupModuleList = DataType.SUP_MODULE_LIST\r
             self.Module.LibraryClasses.append(LibraryClass)\r
         \r
         #Packages\r
@@ -569,7 +571,7 @@ class Inf(InfObject):
         \r
 if __name__ == '__main__':\r
     m = Inf()\r
-    directory = 'C:\Documents and Settings\\hchen30\\Desktop\\prototype\\inf'\r
+    directory = 'C:\MyWorkspace\MdePkg\Library\BaseLib'\r
     fileList = []\r
     \r
     for f in os.listdir(directory):\r