]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
comment out item type checking temporarily when adding module to fpd file.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFileContents.java
index 617f74e0bd95996366a01a7159860a442c7e7b5b..b8c80b48cc2f5264d6b8f354beedc5040bc4dc29 100644 (file)
@@ -182,7 +182,7 @@ public class FpdFileContents {
     }\r
     \r
     public int getFrameworkModulesCount() {\r
-        if (getfpdFrameworkModules().getModuleSAList() == null){\r
+        if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0){\r
             removeElement(getfpdFrameworkModules());\r
             fpdFrameworkModules = null;\r
             return 0;\r
@@ -223,7 +223,7 @@ public class FpdFileContents {
     \r
     public ModuleSADocument.ModuleSA getModuleSA(String key) {\r
         String[] s = key.split(" ");\r
-        if (getfpdFrameworkModules().getModuleSAList() == null) {\r
+        if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0) {\r
             removeElement(getfpdFrameworkModules());\r
             fpdFrameworkModules = null;\r
             return null;\r
@@ -231,7 +231,7 @@ public class FpdFileContents {
         ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator();\r
         while(li.hasNext()) {\r
             ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next();\r
-            if (msa.getModuleGuid().equals(s[0]) && msa.getPackageGuid().equals(s[2])) {\r
+            if (msa.getModuleGuid().equalsIgnoreCase(s[0]) && msa.getPackageGuid().equalsIgnoreCase(s[2])) {\r
                 if (msa.getModuleVersion() != null) {\r
                     if (!msa.getModuleVersion().equals(s[1])) {\r
                         continue;\r
@@ -776,7 +776,7 @@ public class FpdFileContents {
                     //\r
                     // ToDo Error \r
                     //\r
-                    throw new PcdDeclNotFound(mi.getName() + " " + msaPcd.getCName());\r
+                    throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + " in Module " + mi.getName());\r
                 }\r
                 //\r
                 // AddItem to ModuleSA PcdBuildDefinitions\r
@@ -788,7 +788,7 @@ public class FpdFileContents {
             \r
         }\r
         catch (Exception e){\r
-            e.printStackTrace();\r
+            \r
             throw e; \r
         }\r
         \r
@@ -873,16 +873,17 @@ public class FpdFileContents {
         //\r
         // Special dynamic type, if this pcd already exists in other ModuleSA\r
         //\r
+        /* Comment out Item type checking temporarily.\r
         if (itemType.equals("DYNAMIC")) {\r
             \r
             ListIterator li = pcdConsumer.listIterator();\r
             while(li.hasNext()) {\r
                 String value = li.next().toString();\r
                 String[] valuePart= value.split(" ");\r
-                if (!valuePart[4].equals("DYNAMIC")) {\r
+                if (!valuePart[5].equals("DYNAMIC")) {\r
                     //ToDo error for same pcd, other type than dynamic\r
                     pcdConsumer.remove(listValue);\r
-                    throw new PcdItemTypeConflictException(value);\r
+                    throw new PcdItemTypeConflictException(cName, value);\r
                 }\r
             }\r
         }\r
@@ -891,14 +892,14 @@ public class FpdFileContents {
             while(li.hasNext()) {\r
                 String value = li.next().toString();\r
                 String[] valuePart= value.split(" ");\r
-                if (valuePart[4].equals("DYNAMIC")) {\r
+                if (valuePart[5].equals("DYNAMIC")) {\r
                     //ToDo error for same pcd, other type than non-dynamic\r
                     pcdConsumer.remove(listValue);\r
-                    throw new PcdItemTypeConflictException(value);\r
+                    throw new PcdItemTypeConflictException(cName, value);\r
                 }\r
             }\r
         }\r
-        \r
+        */\r
         PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData fpdPcd = moduleSa.getPcdBuildDefinition().addNewPcdData();\r
         fpdPcd.setCName(cName);\r
         fpdPcd.setToken(token);\r
@@ -1030,11 +1031,11 @@ public class FpdFileContents {
     \r
     private ArrayList<String> LookupPlatformPcdData(String pcdKey) {\r
         \r
-        return dynPcdMap.get("pcdKey");\r
+        return dynPcdMap.get(pcdKey);\r
     }\r
     \r
     public int getDynamicPcdBuildDataCount() {\r
-        if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null) {\r
+        if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {\r
             removeElement(getfpdDynPcdBuildDefs());\r
             fpdDynPcdBuildDefs = null;\r
             return 0;\r
@@ -1043,7 +1044,7 @@ public class FpdFileContents {
     }\r
     \r
     public void getDynamicPcdBuildData(String[][] saa) {\r
-        if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null) {\r
+        if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {\r
             removeElement(getfpdDynPcdBuildDefs());\r
             fpdDynPcdBuildDefs = null;\r
             return ;\r
@@ -1962,6 +1963,10 @@ public class FpdFileContents {
     \r
     public void getPlatformDefsSkuInfos(String[][] saa){\r
         if (getfpdPlatformDefs().getSkuInfo() == null || getfpdPlatformDefs().getSkuInfo().getUiSkuNameList() == null) {\r
+            if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null) {\r
+                removeElement(getfpdDynPcdBuildDefs());\r
+                fpdDynPcdBuildDefs = null;\r
+            }\r
             return ;\r
         }\r
         \r
@@ -2316,7 +2321,7 @@ public class FpdFileContents {
         if (fpdHdr == null) {\r
             fpdHdr = fpdRoot.addNewPlatformHeader();\r
         }\r
-        genPlatformDefsSkuInfo("0", "DEFAULT");\r
+        \r
         return fpdHdr;\r
     }\r
     \r
@@ -2460,8 +2465,9 @@ class PcdItemTypeConflictException extends Exception {
     private static final long serialVersionUID = 1L;\r
     private String details = null;\r
     \r
-    PcdItemTypeConflictException(String info){\r
-        details = info;\r
+    PcdItemTypeConflictException(String pcdName, String info){\r
+        ModuleIdentification mi = GlobalData.getModuleId(info);\r
+        details = pcdName + " ItemType Conflicts with " + mi.getName() + " in Pkg " + mi.getPackage().getName();\r
     }\r
     \r
     public String getMessage() {\r
@@ -2478,7 +2484,7 @@ class PcdDeclNotFound extends Exception {
     private String details = null;\r
     \r
     PcdDeclNotFound(String info) {\r
-        details = info;\r
+        details = "PcdDeclNotFound: " + info;\r
     }\r
     \r
     public String getMessage() {\r
@@ -2495,7 +2501,7 @@ class PcdValueMalFormed extends Exception {
     private String details = null;\r
     \r
     PcdValueMalFormed(String info) {\r
-        details = info;\r
+        details = "PcdValueMalFormed: " + info;\r
     }\r
     \r
     public String getMessage() {\r