]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
Fixed grammar in messages.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / FfsProcess.java
index 2d8ed0b0239d53d62bcd3899309a354ecb551ec6..15f975901b73c2c5d9630e8f5582432bef633e57 100644 (file)
@@ -164,7 +164,7 @@ public class FfsProcess {
             System.out.println("Warning: this module doesn't specify a FfsFormatKey. ");\r
             }\r
         else {\r
-            throw new BuildException("Can't find FfsFormatKey [" + buildType + "] in FPD file. ");            \r
+            throw new BuildException("Can't find the FfsFormatKey [" + buildType + "] attribute in the FPD file!");            \r
         }\r
 \r
         if (ffs == null) {\r
@@ -345,20 +345,55 @@ public class FfsProcess {
     **/\r
     private void dealSection(int mode, Document doc, Element root, XmlCursor cursor, Vector<String> list) {\r
         String type = cursor.getAttributeText(new QName("SectionType"));\r
-        list.addElement(type);\r
+        \r
+        //\r
+        // Judge if file is specified? Yes, just use the file, else call Build Macro\r
+        // If fileName is null, means without FileNames specify in FPD file\r
+        //\r
+        String fileName = null;\r
+        cursor.push();\r
+        if (cursor.toFirstChild()) {\r
+            do {\r
+                if (cursor.getName().getLocalPart().equalsIgnoreCase("Filenames")) {\r
+                    cursor.push();\r
+                    if (cursor.toFirstChild()) {\r
+                        do {\r
+                            if (cursor.getName().getLocalPart().equalsIgnoreCase("Filename")) {\r
+                                fileName = cursor.getTextValue();\r
+                            }\r
+                        } while (cursor.toNextSibling());\r
+                    }\r
+                    cursor.pop();\r
+                }\r
+            } while (cursor.toNextSibling());\r
+        }\r
+\r
+        cursor.pop();\r
+        \r
+        if (fileName == null) {\r
+            list.addElement(type);\r
+        }\r
         if (mode == MODE_GUID_DEFINED) {\r
             //\r
             // <input file="${DEST_DIR_OUTPUT}\Bds.pe32"/>\r
             //\r
             Element ele = doc.createElement("input");\r
-            ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+            if (fileName == null) {\r
+                ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+            } else {\r
+                ele.setAttribute("file", "${PLATFORM_DIR}" + File.separatorChar + fileName);\r
+            }\r
             root.appendChild(ele);\r
         } else {\r
             //\r
             // <sectFile fileName= "..."/>\r
             //\r
             Element ele = doc.createElement("sectFile");\r
-            ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+            if (fileName == null) {\r
+                ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+            } else {\r
+                ele.setAttribute("fileName", "${PLATFORM_DIR}" + File.separatorChar + fileName);\r
+            }\r
             root.appendChild(ele);\r
         }\r
     }\r