]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fixes:
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Jul 2006 03:36:11 +0000 (03:36 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Jul 2006 03:36:11 +0000 (03:36 +0000)
1.SpdHeader, FpdHeader not save specification.
2.  PackageSurfaceArea.LibraryClassDeclarations Show Recommended Library Instance UiName, not the GUID.
PackageSurfaceArea.MsaFiles - make table fill the window.
3.   PlatformSurfaceArea.PlatformDefinitions.IntermediateDirectories Do NOT create EMPTY <OutputDirectory/>
4.   Do NOT create EMPTY <FrameworkModules/>
5.   When adding a module, pop up the module settings to let you know that you have added the module.

6.  PlatformSurfaceArea.BuildOptions.Options.Option Do not require ToolFamily - default should be not specified.

7.  PlatformSurfaceArea.BuildOptions.UserDefinedAntTasks
Ant Task File should have a browse button
Id column should only be width of 8 characters.

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

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/GlobalData.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/Spd.java

index 36395bda28399bea8fd072047daa5d525a7c26ba..7781a3d7c82e8f9649758690b77d2684ebbe822a 100644 (file)
@@ -502,7 +502,7 @@ public class SpdHeader extends IInternalFrame {
             if (sfc.getSpdHdrSpec() != null) {\r
                 jTextFieldSpecification.setText(sfc.getSpdHdrSpec());\r
             }\r
             if (sfc.getSpdHdrSpec() != null) {\r
                 jTextFieldSpecification.setText(sfc.getSpdHdrSpec());\r
             }\r
-\r
+            sfc.setSpdHdrSpec(jTextFieldSpecification.getText());\r
     }\r
 \r
     /**\r
     }\r
 \r
     /**\r
index 1eb8a8e166a73f3c92eb45aca64abc0f4d14536a..eca407340841050c5af3fc5d4e5feb910ea2fb6c 100644 (file)
@@ -270,7 +270,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             String lib = m.getValueAt(row, 0) + "";\r
             String hdr = m.getValueAt(row, 1) + "";\r
             String hlp = m.getValueAt(row, 2) + "";\r
             String lib = m.getValueAt(row, 0) + "";\r
             String hdr = m.getValueAt(row, 1) + "";\r
             String hlp = m.getValueAt(row, 2) + "";\r
-            String guid = m.getValueAt(row, 3) + "";\r
+            String name = m.getValueAt(row, 3) + "";\r
             String ver = m.getValueAt(row, 4) + "";\r
             String arch = null;\r
             if (m.getValueAt(row, 5) != null) {\r
             String ver = m.getValueAt(row, 4) + "";\r
             String arch = null;\r
             if (m.getValueAt(row, 5) != null) {\r
@@ -285,6 +285,10 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
                 return;\r
             }\r
             docConsole.setSaved(false);\r
                 return;\r
             }\r
             docConsole.setSaved(false);\r
+            \r
+            getLibInstances(lib);\r
+            String guid = nameToGuid(name);\r
+            \r
             sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);\r
         }\r
     }\r
             sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);\r
         }\r
     }\r
@@ -389,6 +393,11 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
         sfc.getSpdLibClassDeclarations(saa);\r
         int i = 0;\r
         while (i < saa.length) {\r
         sfc.getSpdLibClassDeclarations(saa);\r
         int i = 0;\r
         while (i < saa.length) {\r
+            if (saa[i][3] != null && saa[i][3].length() > 0) {\r
+                getLibInstances(saa[i][0]);\r
+                saa[i][3] = guidToName(saa[i][3]);\r
+            }\r
+            \r
             model.addRow(saa[i]);\r
             i++;\r
         }\r
             model.addRow(saa[i]);\r
             i++;\r
         }\r
@@ -528,7 +537,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
         if (arg0.getSource() == jButtonAdd) {\r
             \r
             //ToDo: check before add\r
         if (arg0.getSource() == jButtonAdd) {\r
             \r
             //ToDo: check before add\r
-            String[] row = {null, null, null, jTextField1.getText(), jTextField2.getText(), null, null};\r
+            String[] row = {null, null, null, jComboBox.getSelectedItem()+"", jTextField2.getText(), null, null};\r
             row[0] = jTextFieldAdd.getText();\r
             row[1] = jTextField.getText().replace('\\', '/');\r
             row[2] = jTextFieldHelp.getText();\r
             row[0] = jTextFieldAdd.getText();\r
             row[1] = jTextField.getText().replace('\\', '/');\r
             row[2] = jTextFieldHelp.getText();\r
@@ -546,7 +555,12 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             model.addRow(row);\r
             jTable.changeSelection(model.getRowCount()-1, 0, false, false);\r
             docConsole.setSaved(false);\r
             model.addRow(row);\r
             jTable.changeSelection(model.getRowCount()-1, 0, false, false);\r
             docConsole.setSaved(false);\r
-            sfc.genSpdLibClassDeclarations(row[0], row[3], row[1], row[2], row[5], null, null, row[4], null, row[6]);\r
+            //\r
+            //convert to GUID before storing recommended lib instance.\r
+            //\r
+            getLibInstances(row[0]);\r
+            String recommendGuid = nameToGuid(row[3]);\r
+            sfc.genSpdLibClassDeclarations(row[0], recommendGuid, row[1], row[2], row[5], null, null, row[4], null, row[6]);\r
             \r
         }\r
         //\r
             \r
         }\r
         //\r
@@ -847,6 +861,32 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
         \r
     }\r
 \r
         \r
     }\r
 \r
+    private String nameToGuid(String name) {\r
+        String s = "";\r
+        if (!libNameGuidMap.containsKey(name)) {\r
+            return s;\r
+        }\r
+        \r
+        s = libNameGuidMap.get(name);\r
+        return s;\r
+    }\r
+    \r
+    private String guidToName(String guid){\r
+        String s = "";\r
+        if (!libNameGuidMap.containsValue(guid)) {\r
+            return s;\r
+        }\r
+        Set<String> key = libNameGuidMap.keySet();\r
+        Iterator<String> is = key.iterator();\r
+        while(is.hasNext()) {\r
+            s = is.next();\r
+            if (libNameGuidMap.get(s).equals(guid)) {\r
+                break;\r
+            }\r
+        }\r
+        return s;\r
+    }\r
+\r
 }\r
 \r
 \r
 }\r
 \r
 \r
index 0fbffe0837acd4b133f3a155be23a2093d7d6f3e..1fcece4a37628302d866e4606f46e02225c11bc2 100644 (file)
@@ -213,26 +213,16 @@ public class FpdFileContents {
         while(li.hasNext()) {\r
             ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next();\r
             if (msa.getModuleGuid().equals(s[0]) && msa.getPackageGuid().equals(s[2])) {\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.getModuleVersion() != null) {\r
-//                    if (!msa.getModuleVersion().equals(s[1])) {\r
-//                        continue;\r
-//                    }\r
-//                }\r
-//                else{\r
-//                    if (s[1] != null) {\r
-//                        continue;\r
-//                    }\r
-//                }\r
-//                if (msa.getPackageVersion() != null) {\r
-//                    if (!msa.getPackageVersion().equals(s[3])) {\r
-//                        continue;\r
-//                    }\r
-//                }\r
-//                else{\r
-//                    if (s[3] != null) {\r
-//                        continue;\r
-//                    }\r
-//                }\r
+                if (msa.getModuleVersion() != null) {\r
+                    if (!msa.getModuleVersion().equals(s[1])) {\r
+                        continue;\r
+                    }\r
+                }\r
+                if (msa.getPackageVersion() != null) {\r
+                    if (!msa.getPackageVersion().equals(s[3])) {\r
+                        continue;\r
+                    }\r
+                }\r
                 return msa;\r
             }\r
         }\r
                 return msa;\r
             }\r
         }\r
index cb2a5aa4206911a218c98be99153f0235e39e4d9..c2d9985c3460457ae4ffe0ceb62eb9e5fc9845cd 100644 (file)
@@ -442,15 +442,24 @@ public class FpdFrameworkModules extends IInternalFrame {
         while(ispi.hasNext()) {\r
             PackageIdentification pi = (PackageIdentification)ispi.next();\r
             if ( !pi.getGuid().equals(keyPart[2])){ \r
         while(ispi.hasNext()) {\r
             PackageIdentification pi = (PackageIdentification)ispi.next();\r
             if ( !pi.getGuid().equals(keyPart[2])){ \r
-//                            || !pi.getVersion().equals(keyPart[3])){\r
+\r
+                continue;\r
+            }\r
+            if (keyPart[3] != null && keyPart[3].length() > 0 && !keyPart[3].equals("null")){\r
+                if(!pi.getVersion().equals(keyPart[3])){\r
                 continue;\r
             }\r
                 continue;\r
             }\r
+            }\r
             Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
             Iterator ismi = smi.iterator();\r
             while(ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
                 if (mi.getGuid().equals(keyPart[0])){\r
             Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
             Iterator ismi = smi.iterator();\r
             while(ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
                 if (mi.getGuid().equals(keyPart[0])){\r
-//                                && mi.getVersion().equals(keyPart[1])){\r
+                    if (keyPart[1] != null && keyPart[1].length() > 0 && !keyPart[1].equals("null")){\r
+                        if(!mi.getVersion().equals(keyPart[1])){\r
+                            continue;\r
+                        }\r
+                    }\r
 \r
                     return mi;\r
                 }\r
 \r
                     return mi;\r
                 }\r
index 21eb70cffb5903b489a0253c8f395d09e7827c6e..73791fe691019320dba2d549b1593f6dc2f688bb 100644 (file)
@@ -508,7 +508,7 @@ public class FpdHeader extends IInternalFrame {
         if (ffc.getFpdHdrSpec() != null) {\r
             jTextFieldSpecification.setText(ffc.getFpdHdrSpec());\r
         }\r
         if (ffc.getFpdHdrSpec() != null) {\r
             jTextFieldSpecification.setText(ffc.getFpdHdrSpec());\r
         }\r
-            \r
+        ffc.setFpdHdrSpec(jTextFieldSpecification.getText());    \r
     }\r
 \r
     /**\r
     }\r
 \r
     /**\r
index fe565d97edbd0fcb15d2f21596dbdf02794e4c3f..bdb278c5708bbfce716922bea0b9c13bf5228779 100644 (file)
@@ -406,120 +406,6 @@ public class GlobalData {
         }\r
     }\r
 \r
         }\r
     }\r
 \r
-    /**\r
-      The header file path is relative to workspace dir\r
-    **/\r
-    public static String[] getLibraryClassHeaderFiles(PackageIdentification[] packages, String name) {\r
-        if (packages == null ){\r
-            // throw Exception or not????\r
-            return new String[0];\r
-        }\r
-        String[] result = null;\r
-        for (int i = 0; i < packages.length; i++){\r
-            Spd spd = spdTable.get(packages[i]);\r
-            //\r
-            // If find one package defined the library class\r
-            //\r
-            if( (result = spd.getLibClassIncluder(name)) != null){\r
-                return result;\r
-            } \r
-        }\r
-        return null;\r
-        \r
-    }\r
-    \r
-    /**\r
-      The header file path is relative to workspace dir\r
-    **/    \r
-    public static String getPackageHeaderFiles(PackageIdentification packages, String moduleType) throws Exception {\r
-        if (packages == null ){\r
-            return new String("");\r
-        }\r
-        Spd spd = spdTable.get(packages);\r
-        //\r
-        // If can't find package header file, skip it\r
-        //\r
-        String temp = null;\r
-        if (spd != null){\r
-               if( (temp = spd.getPackageIncluder(moduleType)) != null){\r
-                return temp;\r
-            }else {\r
-               temp = "";\r
-               return temp;\r
-            }\r
-        }else {\r
-               return null;\r
-        }\r
-    }   \r
-    \r
-    /**\r
-      return two values: {cName, GuidValue}\r
-    **/\r
-    public static String[] getGuid(PackageIdentification[] packages, String name) throws Exception {\r
-        if (packages == null ){\r
-            // throw Exception or not????\r
-            return new String[0];\r
-        }\r
-        String[] result = null;\r
-        for (int i = 0; i < packages.length; i++){\r
-            Spd spd = spdTable.get(packages[i]);\r
-            //\r
-            // If find one package defined the GUID\r
-            //\r
-            if( (result = spd.getGuid(name)) != null){\r
-                return result;\r
-            }\r
-        }\r
-        return null;\r
-    }\r
-    \r
-    /**\r
-      return two values: {cName, GuidValue}\r
-    **/    \r
-    public static String[] getPpiGuid(PackageIdentification[] packages, String name) throws Exception {\r
-        if (packages == null ){\r
-            return new String[0];\r
-        }\r
-        String[] result = null;\r
-        for (int i = 0; i < packages.length; i++){\r
-            Spd spd = spdTable.get(packages[i]);\r
-            //\r
-            // If find one package defined the Ppi GUID\r
-            //\r
-            if( (result = spd.getPpi(name)) != null){\r
-                return result;\r
-            }\r
-        }\r
-        return null;\r
-        \r
-    }\r
-    \r
-    /**\r
-      return two values: {cName, GuidValue}\r
-    **/   \r
-    public static String[] getProtocolGuid(PackageIdentification[] packages, String name) throws Exception {\r
-        if (packages == null ){\r
-            return new String[0];\r
-        }\r
-        String[] result = null;\r
-        for (int i = 0; i < packages.length; i++){\r
-            Spd spd = spdTable.get(packages[i]);\r
-            //\r
-            // If find one package defined the protocol GUID\r
-            //\r
-            if( (result = spd.getProtocol(name)) != null){\r
-                return result;\r
-            }\r
-        }\r
-        return null;\r
-        \r
-    }\r
-    \r
-    /////////////////////////// Update!! Update!! Update!!\r
-//    public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {\r
-//        return pcdDbManager;\r
-//    }\r
-    ///////////////////////////\r
     public synchronized static PlatformIdentification getPlatform(String name) throws Exception {\r
         Iterator iter = platformList.iterator();\r
         while(iter.hasNext()){\r
     public synchronized static PlatformIdentification getPlatform(String name) throws Exception {\r
         Iterator iter = platformList.iterator();\r
         while(iter.hasNext()){\r
index 11b0e073f29735b04fe2f600a094b93b27b8b9b4..914c5bf1cd34b038f2c3c2d10f4b55620f7f64e3 100644 (file)
@@ -17,7 +17,6 @@ package org.tianocore.frameworkwizard.platform.ui.global;
 \r
 import java.io.File;\r
 import java.util.HashMap;\r
 \r
 import java.io.File;\r
 import java.util.HashMap;\r
-import java.util.Iterator;\r
 import java.util.Map;\r
 import java.util.Set;\r
 \r
 import java.util.Map;\r
 import java.util.Set;\r
 \r
@@ -35,42 +34,7 @@ public class Spd {
     ///\r
     ///\r
     Map<ModuleIdentification, File> msaInfo = new HashMap<ModuleIdentification, File>();\r
     ///\r
     ///\r
     Map<ModuleIdentification, File> msaInfo = new HashMap<ModuleIdentification, File>();\r
-\r
-    ///\r
-    /// Map of module info. \r
-    /// Key : moduletype\r
-    /// Value: moduletype related include file\r
-    ///\r
-    Map<String, String> packageHeaderInfo = new HashMap<String, String>();\r
-\r
-    ///\r
-    /// Map of PPI info.\r
-    /// Key : PPI name\r
-    /// value: String[] a. PPI C_NAME; b. PPI GUID;\r
-    ///\r
-    Map<String, String[]> ppiInfo = new HashMap<String, String[]>();\r
-\r
-    ///\r
-    /// Map of Protocol info.\r
-    /// Key : Protocol name\r
-    /// value: String[] a. Protocol C_NAME; b. Protocol GUID;\r
-    ///\r
-    Map<String, String[]> protocolInfo = new HashMap<String, String[]>();\r
-\r
-    ///\r
-    /// Map of Guid info.\r
-    /// Key : Guid name\r
-    /// value: String[] a. Guid C_NAME; b. Guid's GUID;\r
-    ///\r
-    Map<String, String[]> guidInfo = new HashMap<String, String[]>();\r
-\r
-    ///\r
-    /// Map of library class and its exposed header file.\r
-    /// Key : library class name\r
-    /// value : library class corresponding header file\r
-    ///\r
-    Map<String, String[]> libClassHeaderList = new HashMap<String, String[]>();\r
-\r
+    \r
     //\r
     // Xml Doc of Spd file, Msa file\r
     //\r
     //\r
     // Xml Doc of Spd file, Msa file\r
     //\r
@@ -112,6 +76,9 @@ public class Spd {
             String[] msaFilenames = SurfaceAreaQuery.getSpdMsaFile();\r
             for (int i = 0; i < msaFilenames.length; i++){\r
                 File msaFile = new File(packageId.getPackageDir() + File.separatorChar + msaFilenames[i]);\r
             String[] msaFilenames = SurfaceAreaQuery.getSpdMsaFile();\r
             for (int i = 0; i < msaFilenames.length; i++){\r
                 File msaFile = new File(packageId.getPackageDir() + File.separatorChar + msaFilenames[i]);\r
+                if (!msaFile.exists()) {\r
+                    continue;\r
+                }\r
                 Map<String, XmlObject> msaDoc = GlobalData.getNativeMsa( msaFile );\r
                 SurfaceAreaQuery.push(msaDoc);\r
                 ModuleIdentification moduleId = SurfaceAreaQuery.getMsaHeader();\r
                 Map<String, XmlObject> msaDoc = GlobalData.getNativeMsa( msaFile );\r
                 SurfaceAreaQuery.push(msaDoc);\r
                 ModuleIdentification moduleId = SurfaceAreaQuery.getMsaHeader();\r
@@ -120,57 +87,10 @@ public class Spd {
                 msaInfo.put(moduleId, msaFile);\r
                 msaDocMap.put(moduleId, msaDoc.get("ModuleSurfaceArea"));\r
             }\r
                 msaInfo.put(moduleId, msaFile);\r
                 msaDocMap.put(moduleId, msaDoc.get("ModuleSurfaceArea"));\r
             }\r
-            //\r
-            // initialize Package header files\r
-            //\r
-//            Map<String, String> packageHeaders = SurfaceAreaQuery.getSpdPackageHeaderFiles();\r
-//            Set keys = packageHeaders.keySet();\r
-//            Iterator iter = keys.iterator();\r
-//            while (iter.hasNext()){\r
-//                String moduleType = (String)iter.next();\r
-//                String header = packageId.getPackageRelativeDir() + File.separatorChar + packageHeaders.get(moduleType);\r
-//                //\r
-//                // Change path seperator to system-dependent path separator\r
-//                //\r
-//                File file = new File (header);\r
-//                header = file.getParent();\r
-//                packageHeaderInfo.put(moduleType, header);\r
-//            }\r
-            //\r
-            // initialize Guid Info\r
-            //\r
-            guidInfo.putAll(SurfaceAreaQuery.getSpdGuid());\r
-            //\r
-            // initialize PPI info\r
-            //\r
-            ppiInfo.putAll(SurfaceAreaQuery.getSpdPpi());\r
-            //\r
-            // initialize Protocol info\r
-            //\r
-            protocolInfo.putAll(SurfaceAreaQuery.getSpdProtocol());\r
-            //\r
-            // initialize library class declaration\r
-            //\r
-            Map<String, String[]> libraryClassHeaders = SurfaceAreaQuery.getSpdLibraryClasses();\r
-            Set<String> keys = libraryClassHeaders.keySet();\r
-            Iterator iter = keys.iterator();\r
-            while (iter.hasNext()){\r
-                String libraryClassName = (String)iter.next();\r
-                String[] headerFiles = libraryClassHeaders.get(libraryClassName);\r
-                for (int i = 0; i < headerFiles.length; i++){\r
-                    headerFiles[i] = packageId.getPackageRelativeDir() + File.separatorChar + headerFiles[i];\r
-                    \r
-                    //\r
-                    // Change path separator to system system-dependent path separator. \r
-                    //\r
-                    File file = new File (headerFiles[i]);\r
-                    headerFiles[i] = file.getPath();\r
-                }\r
-                libClassHeaderList.put(libraryClassName, headerFiles);\r
-            }\r
+            \r
         }\r
         catch (Exception e) {\r
         }\r
         catch (Exception e) {\r
-            e.setStackTrace(e.getStackTrace());\r
+            \r
             throw new Exception("Parse package description file [" + packageId.getSpdFile() + "] Error.\n"\r
                                      + e.getMessage());\r
         }\r
             throw new Exception("Parse package description file [" + packageId.getSpdFile() + "] Error.\n"\r
                                      + e.getMessage());\r
         }\r
@@ -187,51 +107,5 @@ public class Spd {
     public Set<ModuleIdentification> getModules(){\r
         return msaInfo.keySet();\r
     }\r
     public Set<ModuleIdentification> getModules(){\r
         return msaInfo.keySet();\r
     }\r
-\r
-    /**\r
-       return two value {CName, Guid}. If not found, return null.\r
-     **/\r
-    public String[] getPpi(String ppiName) {\r
-        return ppiInfo.get(ppiName);\r
-    }\r
-\r
-    /**\r
-        return two value {CName, Guid}. If not found, return null.\r
-    **/\r
-    public String[] getProtocol(String protocolName) {\r
-        return protocolInfo.get(protocolName);\r
-    }\r
-\r
-    /**\r
-      return two value {CName, Guid}. If not found, return null.\r
-    **/\r
-    public String[] getGuid(String guidName) {\r
-        return guidInfo.get(guidName);\r
-    }\r
-\r
-    /**\r
-     getLibClassInclude \r
-     \r
-     This function is to get the library exposed header file name according \r
-     library class name.\r
-     \r
-     @param     libName    Name of library class   \r
-     @return               Name of header file\r
-    **/\r
-    String[] getLibClassIncluder(String libName) {\r
-        return libClassHeaderList.get(libName);\r
-    }\r
-\r
-    /**\r
-      getModuleTypeIncluder\r
     \r
     \r
-      This function is to get the header file name from module info map \r
-      according to module type.\r
-    \r
-      @param   moduleType    Module type.\r
-      @return                Name of header file.\r
-    **/\r
-    String getPackageIncluder(String moduleType) {\r
-        return packageHeaderInfo.get(moduleType);\r
-    }\r
 }\r
 }\r