fix some bugs of EdkIIWorkspaceBuild.py
authorjjin9 <jjin9@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 25 Jul 2007 02:48:35 +0000 (02:48 +0000)
committerjjin9 <jjin9@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 25 Jul 2007 02:48:35 +0000 (02:48 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@388 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/EdkIIWorkspaceBuild.py

index c4fb5df..7a32a90 100644 (file)
 import os, string, copy, pdb\r
 import EdkLogger\r
 import DataType\r
-from EdkIIWorkspace import *\r
-from TargetTxtClassObject import *\r
-from ToolDefClassObject import *\r
 from InfClassObject import *\r
 from DecClassObject import *\r
 from DscClassObject import *\r
 from String import *\r
 from BuildToolError import *\r
-\r
+from CommonDataClass.CommonClass import *\r
 \r
 class ModuleSourceFilesClassObject(object):\r
     def __init__(self, SourceFile = '', PcdFeatureFlag = '', TagName = '', ToolCode = '', ToolChainFamily = '', String = ''):\r
@@ -314,7 +311,6 @@ class WorkspaceBuild(object):
                 #LibraryClass\r
                 for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
                     #['DebugLib|MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf', ['DXE_CORE']]\r
-                    print dscObj.Contents[key].LibraryClasses[index]\r
                     list = dscObj.Contents[key].LibraryClasses[index][0].split(DataType.TAB_VALUE_SPLIT, 1)\r
                     type = dscObj.Contents[key].LibraryClasses[index][1][0]\r
                     pb.LibraryClasses[(list[0], type)] = NormPath(list[1])\r
@@ -340,11 +336,11 @@ class WorkspaceBuild(object):
                     pcd.append(None)\r
                     SkuName = dscObj.Contents[key].PcdsDynamicDefault[index][1]\r
                     SkuInfoList = []\r
-                    if SkuName == None:\r
+                    if SkuName == None or SkuName == []:\r
                         SkuName = ['DEFAULT']\r
-                    SkuNameList = map(lambda l: l.strip(), SkuName.split(DataType.TAB_VALUE_SPLIT))\r
+                    SkuNameList = map(lambda l: l.strip(), SkuName[0].split(DataType.TAB_VALUE_SPLIT))\r
                     for Item in SkuNameList:\r
-                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo = SkuInfoClass()\r
                         SkuInfo.SkuId = pb.SkuIds[Item]\r
                         SkuInfo.DefaultValue = pcd[2]\r
                         SkuInfoList.append(SkuInfo)\r
@@ -608,7 +604,7 @@ class WorkspaceBuild(object):
                 #LibraryClasses\r
                 for index in range(len(infObj.Contents[key].LibraryClasses)):\r
                     #Get LibraryClass name and default instance if existing\r
-                    list = infObj.Contents[key].LibraryClasses[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    list = infObj.Contents[key].LibraryClasses[index][0].split(DataType.TAB_VALUE_SPLIT)\r
                     if len(list) < 2:\r
                         v = ''\r
                     else:\r
@@ -770,7 +766,8 @@ class WorkspaceBuild(object):
 if __name__ == '__main__':\r
 \r
     # Nothing to do here. Could do some unit tests.\r
-    ewb = WorkspaceBuild('EdkModulePkg/EdkModulePkg.dsc', 'C:/MyWorkspace')\r
+    w = os.getenv('WORKSPACE')\r
+    ewb = WorkspaceBuild('MdeModulePkg/MdeModulePkg.dsc', w)\r
     ewb.GenBuildDatabase()\r
     #print ewb.DscDatabase\r
     #print ewb.InfDatabase\r