Fix two transition issue:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jun 2006 04:01:11 +0000 (04:01 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jun 2006 04:01:11 +0000 (04:01 +0000)
1) Although current PCD tool's code support use packageName, packageGuid, version, arch to identify a module, but these value can not be got from FPD file, so use null for transition phase.
2) Add transition code to check <TokenSpaceGuid>, In future, the checking work should be done by schema checking tools when change occur of <TokenSpaceGuid> from[0..1] to [1] in schema.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@508 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java

index fe09be2b9ab136c8297cf413a8cba2c0431a322a..473247f847bf07d2e96a7a344cbd3989111841ca 100644 (file)
@@ -1485,15 +1485,15 @@ public class CollectPCDAction {
                 // <ModuleSAs>, It is work around code.\r
                 // \r
                 primaryKey1 = UsageInstance.getPrimaryKey(modules.get(index).module.getModuleName(), \r
-                                                          translateSchemaStringToUUID(modules.get(index).module.getModuleGuid()),\r
-                                                          modules.get(index).module.getPackageName()\r
-                                                          translateSchemaStringToUUID(modules.get(index).module.getPackageGuid())\r
+                                                          null,\r
+                                                          null\r
+                                                          null\r
                                                           modules.get(index).module.getArch().toString(),\r
                                                           null);\r
                 primaryKey2 = UsageInstance.getPrimaryKey(modules.get(index2).module.getModuleName(), \r
-                                                          translateSchemaStringToUUID(modules.get(index2).module.getModuleGuid())\r
-                                                          modules.get(index2).module.getPackageName()\r
-                                                          translateSchemaStringToUUID(modules.get(index2).module.getPackageGuid())\r
+                                                          null\r
+                                                          null\r
+                                                          null\r
                                                           modules.get(index2).module.getArch().toString(), \r
                                                           null);\r
                 if (primaryKey1.equalsIgnoreCase(primaryKey2)) {\r
@@ -1532,6 +1532,17 @@ public class CollectPCDAction {
                 datum        = pcdBuildData.getValue();\r
                 maxDatumSize = pcdBuildData.getMaxDatumSize();\r
 \r
+                //\r
+                // Check <TokenSpaceGuid> is exist? In future, because all schema verification will tools\r
+                // will check that, following checking code could be removed.\r
+                // \r
+                if (pcdBuildData.getTokenSpaceGuid() == null) {\r
+                    exceptionString = String.format("[FPD file error] There is no <TokenSpaceGuid> for PCD %s in module %s! This is required!",\r
+                                                    pcdBuildData.getCName(),\r
+                                                    moduleName);\r
+                    throw new EntityException(exceptionString);\r
+                }\r
+\r
                 //\r
                 // -------------------------------------------------------------------------------------------\r
                 // 2.1.1), Do some necessary checking work for FixedAtBuild, FeatureFlag and PatchableInModule\r
@@ -1676,9 +1687,9 @@ public class CollectPCDAction {
                 // \r
                 usageInstance = new UsageInstance(token, \r
                                                   moduleName, \r
-                                                  translateSchemaStringToUUID(modules.get(index).module.getModuleGuid()),\r
-                                                  modules.get(index).module.getPackageName(),\r
-                                                  translateSchemaStringToUUID(modules.get(index).module.getPackageGuid()),\r
+                                                  null,\r
+                                                  null,\r
+                                                  null,\r
                                                   modules.get(index).type, \r
                                                   pcdType,\r
                                                   modules.get(index).module.getArch().toString(), \r
@@ -1734,6 +1745,16 @@ public class CollectPCDAction {
 \r
         dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();\r
         for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {\r
+            //\r
+            // Check <TokenSpaceGuid> is exist? In future, because all schema verification will tools\r
+            // will check that, following checking code could be removed.\r
+            // \r
+            if (dynamicPcdBuildDataArray.get(index).getTokenSpaceGuid() == null) {\r
+                exceptionString = String.format("[FPD file error] There is no <TokenSpaceGuid> for PCD %s in <DynamicPcdBuildDefinitions>! This is required!",\r
+                                                dynamicPcdBuildDataArray.get(index).getCName());\r
+                throw new EntityException(exceptionString);\r
+            }\r
+\r
             dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),\r
                                                           translateSchemaStringToUUID(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuid()));\r
             if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {\r