1) Change the schema type for <VariableGuid> used in PCD HiiEnable group in FPD file.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Jun 2006 05:39:54 +0000 (05:39 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Jun 2006 05:39:54 +0000 (05:39 +0000)
2) Modify PCD tools to support that.

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

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

index f9de63fc0d208173a1e1ba686027e418ed80f449..dc60cc6eb75ae1d5e29cfaf68ce43e055bacfc4c 100644 (file)
@@ -2133,6 +2133,7 @@ public class CollectPCDAction {
         Token.PCD_TYPE      pcdType         = Token.PCD_TYPE.UNKNOWN;\r
         int                 tokenNumber     = 0;\r
         String              hiiDefaultValue = null;\r
+        String[]            variableGuidString = null;\r
 \r
         List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo>   skuInfoList = null;\r
         DynamicPcdBuildDefinitions.PcdBuildData                 dynamicInfo = null;\r
@@ -2240,7 +2241,9 @@ public class CollectPCDAction {
                                                     "file, who use HII, but there is no <VariableGuid> defined for Sku %d data!",\r
                                                     token.cName,\r
                                                     index);\r
-                                                    \r
+                    if (exceptionString != null) {\r
+                        throw new EntityException(exceptionString);\r
+                    }                                                    \r
                 }\r
 \r
                 if (skuInfoList.get(index).getVariableOffset() == null) {\r
@@ -2248,6 +2251,9 @@ public class CollectPCDAction {
                                                     "file, who use HII, but there is no <VariableOffset> defined for Sku %d data!",\r
                                                     token.cName,\r
                                                     index);\r
+                    if (exceptionString != null) {\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
                 }\r
 \r
                 if (skuInfoList.get(index).getHiiDefaultValue() == null) {\r
@@ -2255,12 +2261,11 @@ public class CollectPCDAction {
                                                     "file, who use HII, but there is no <HiiDefaultValue> defined for Sku %d data!",\r
                                                     token.cName,\r
                                                     index);\r
+                    if (exceptionString != null) {\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
                 }\r
 \r
-                if (exceptionString != null) {\r
-                    throw new EntityException(exceptionString);\r
-                }\r
-                \r
                 if (skuInfoList.get(index).getHiiDefaultValue() != null) {\r
                     hiiDefaultValue = skuInfoList.get(index).getHiiDefaultValue().toString();\r
                 } else {\r
@@ -2283,8 +2288,18 @@ public class CollectPCDAction {
                                                             index));\r
                 }\r
 \r
+                //\r
+                // Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.\r
+                // \r
+                variableGuidString = GlobalData.getGuidInfoGuid(skuInfoList.get(index).getVariableGuid().toString());\r
+                if (variableGuidString == null) {\r
+                    throw new EntityException(String.format("[GUID Error] For dynamic PCD %s,  the variable guid %s can be found in all SPD file!",\r
+                                                            token.cName, \r
+                                                            skuInfoList.get(index).getVariableGuid().toString()));\r
+                }\r
+\r
                 skuInstance.value.setHiiData(skuInfoList.get(index).getVariableName(),\r
-                                             translateSchemaStringToUUID(skuInfoList.get(index).getVariableGuid().toString()),\r
+                                             translateSchemaStringToUUID(variableGuidString[1]),\r
                                              skuInfoList.get(index).getVariableOffset(),\r
                                              skuInfoList.get(index).getHiiDefaultValue().toString());\r
                 token.skuData.add(skuInstance);\r
@@ -2350,6 +2365,9 @@ public class CollectPCDAction {
             return new UUID(0, 0);\r
         }\r
 \r
+        uuidString = uuidString.replaceAll("\\{", "");\r
+        uuidString = uuidString.replaceAll("\\}", "");\r
+\r
         //\r
         // If the UUID schema string is GuidArrayType type then need translate \r
         // to GuidNamingConvention type at first.\r
@@ -2434,11 +2452,11 @@ public class CollectPCDAction {
     **/\r
     public static void main(String argv[]) throws EntityException {\r
         CollectPCDAction ca = new CollectPCDAction();\r
-        ca.setWorkspacePath("m:/tianocore_latest/edk2");\r
-        ca.setFPDFilePath("m:/tianocore_latest/edk2/EdkNt32Pkg/Nt32.fpd");\r
+        ca.setWorkspacePath("m:/tianocore/edk2");\r
+        ca.setFPDFilePath("m:/tianocore/edk2/EdkNt32Pkg/Nt32.fpd");\r
         ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL);\r
         GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",\r
-                            "m:/tianocore_latest/edk2");\r
+                            "m:/tianocore/edk2");\r
         ca.execute();\r
     }\r
 }\r
index 5d9966d740e5deef5f27dc5c1516dc90d3d6e739..d07712a66303c4de9288ad97ba3138e5915c6e2c 100644 (file)
         </xs:annotation>\r
         <xs:sequence>\r
             <xs:element minOccurs="1" maxOccurs="1" name="VariableName" type="VariableNameDataType"/>\r
-            <xs:element minOccurs="0" maxOccurs="1" name="VariableGuid" type="VariableGuidType"/>\r
+            <xs:element minOccurs="0" maxOccurs="1" name="VariableGuid" type="C_NameType"/>\r
             <xs:element minOccurs="1" maxOccurs="1" name="VariableOffset" type="Hex64BitDataType"/>\r
             <xs:element minOccurs="1" maxOccurs="1" name="HiiDefaultValue" type="DefaultValueType"/>\r
         </xs:sequence>\r