add support arch check for pcd entries when adding a module to platform, sync. platfo...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 28 Dec 2006 08:45:08 +0000 (08:45 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 28 Dec 2006 08:45:08 +0000 (08:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2149 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java

index d08202b94ec9f924c3ed691cffc4e418d6089580..979d49ca39ae52af73eb652eeded9a44500935a1 100644 (file)
@@ -427,7 +427,7 @@ public class FpdFileContents {
                     if (nextMi == null) {\r
                         continue;\r
                     }\r
-                    if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], nextMi)) {\r
+                    if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], arch, nextMi)) {\r
                         continue nextPcd;\r
                     }\r
                 }\r
@@ -455,6 +455,13 @@ public class FpdFileContents {
                             }\r
                         }\r
                     }\r
+                    // Check sup arch conformance for the new PCD\r
+                    if (msaPcd.getSupArchList() != null) {\r
+                       String newPcdArch = msaPcd.getSupArchList().toString();\r
+                       if (!newPcdArch.toLowerCase().contains(arch.toLowerCase())) {\r
+                               continue;\r
+                       }\r
+                    }\r
                     \r
                     PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null, vMi.get(i));\r
                     PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);\r
@@ -686,7 +693,7 @@ public class FpdFileContents {
         \r
         int pcdSourceCount = 0;\r
         for (int i = 0; i < vMi.size(); ++i) {\r
-            if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, vMi.get(i))) {\r
+            if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, null, vMi.get(i))) {\r
                 pcdSourceCount++;\r
             }\r
         }\r
@@ -1179,6 +1186,11 @@ public class FpdFileContents {
         ListIterator li = l.listIterator();\r
         while (li.hasNext()) {\r
             PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry) li.next();\r
+            if (msaPcd.getSupArchList() != null) {\r
+               if (!msaPcd.getSupArchList().toString().toLowerCase().contains(arch.toLowerCase())) {\r
+                       continue;\r
+               }\r
+            }\r
             PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);\r
             if (spdPcd == null) {\r
                 //\r
index 2d8b23760e42a7859c9865a53899cbc9f46f5d34..9e4df720b01183de20422d673c94933561362bd9 100644 (file)
@@ -672,17 +672,18 @@ public class FpdFrameworkModules extends IInternalFrame {
     }\r
     \r
     private void showSettingsDlg (int row) {\r
-        try {\r
-            Vector<String> vExceptions = new Vector<String>();\r
-            if (ffc.adjustPcd(row, vExceptions)) {\r
-                JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");\r
-                docConsole.setSaved(false);\r
-            }\r
-        }\r
-        catch (Exception exp) {\r
-            JOptionPane.showMessageDialog(frame, exp.getMessage());\r
-//            return;\r
-        }\r
+//             As PCD sync. check is full platform range now during opening FrameworkModules editor,\r
+//     the following check is no longer needed.\r
+//        try {\r
+//            Vector<String> vExceptions = new Vector<String>();\r
+//            if (ffc.adjustPcd(row, vExceptions)) {\r
+//                JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");\r
+//                docConsole.setSaved(false);\r
+//            }\r
+//        }\r
+//        catch (Exception exp) {\r
+//            JOptionPane.showMessageDialog(frame, exp.getMessage());\r
+//        }\r
         \r
         if (settingDlg == null) {\r
             settingDlg = new FpdModuleSA(ffc);\r
@@ -864,7 +865,7 @@ public class FpdFrameworkModules extends IInternalFrame {
             for (int i = 0; i < vExceptions.size(); ++i) {\r
                 errorMsg += " " + vExceptions.get(i) + "\n";\r
             }\r
-            JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:" + errorMsg);\r
+            JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:\n" + errorMsg);\r
         }\r
     }\r
 \r
index 22bcf498acdfa1edc8e1c702840e0bafe5e46726..fc715516eda5150cc26dd15a8315e32d5b8d810e 100644 (file)
@@ -581,12 +581,21 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         \r
     }\r
     \r
+    private String getModuleArch () {\r
+       String arch = "";\r
+       String[] moduleInfo = moduleKey.split(" ");\r
+       for (int i = 4; i < moduleInfo.length; ++i) {\r
+               arch += moduleInfo[i];\r
+               arch += " ";\r
+       }\r
+       return arch.trim();\r
+    }\r
     private void addLibInstance (ModuleIdentification libMi) throws Exception{\r
         \r
         //\r
         // Add pcd information of selected instance to current moduleSA\r
         //\r
-        ffc.addFrameworkModulesPcdBuildDefs(libMi, null, ffc.getModuleSA(moduleKey));\r
+        ffc.addFrameworkModulesPcdBuildDefs(libMi, getModuleArch(), ffc.getModuleSA(moduleKey));\r
         \r
         ffc.genLibraryInstance(libMi, moduleKey);\r
     }\r
index b06a97b0d7664fb8c20d6494405d54b1424e398f..8b0f4ccc1b3598f7c080e7f5c226c0ece49b0ebd 100644 (file)
@@ -130,7 +130,7 @@ public class WorkspaceProfile {
         return msa.getModuleDefinitions().getOutputFileBasename();\r
     }\r
     \r
-    public static boolean pcdInMsa (String cName, String tsGuid, ModuleIdentification mi) {\r
+    public static boolean pcdInMsa (String cName, String tsGuid, String supArchList, ModuleIdentification mi) {\r
         ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);\r
         if (msa.getPcdCoded() == null || msa.getPcdCoded().getPcdEntryList() == null) {\r
             return false;\r
@@ -139,7 +139,14 @@ public class WorkspaceProfile {
         while (li.hasNext()) {\r
             PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry)li.next();\r
             if (msaPcd.getCName().equals(cName) && msaPcd.getTokenSpaceGuidCName().equals(tsGuid)) {\r
-                return true;\r
+                if (supArchList != null && msaPcd.getSupArchList() != null) {\r
+                       if (msaPcd.getSupArchList().toString().toLowerCase().contains(supArchList.trim().toLowerCase())) {\r
+                               return true;\r
+                       }\r
+                }\r
+                else{\r
+                       return true;\r
+                }\r
             }\r
         }\r
         return false;\r