//\r
Element outofdateEle = document.createElement("OnDependency");\r
Element sourceEle = document.createElement("sourcefiles");\r
- String[] result = new String[sectionList.size()];\r
+ Vector<String> sections = new Vector<String>();\r
for (int i = 0; i < sectionList.size(); i++) {\r
- result[i] = (String) sectionList.get(i);\r
+ String section = (String) sectionList.get(i);\r
+ if (isSectionType(section)) {\r
+ sections.addElement(section);\r
+ }\r
Element pathEle = document.createElement("file");\r
- pathEle.setAttribute("name", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename\r
- + getSectionExt(result[i]));\r
+ pathEle.setAttribute("name", getSectionFile(basename, section));\r
sourceEle.appendChild(pathEle);\r
}\r
+ String[] result = sections.toArray(new String[sections.size()]);\r
+\r
outofdateEle.appendChild(sourceEle);\r
Element targetEle = document.createElement("targetfiles");\r
Element fileEle = document.createElement("file");\r
\r
if (fileName == null) {\r
list.addElement(type);\r
+ } else {\r
+ list.addElement(fileName);\r
}\r
+\r
if (mode == MODE_GUID_DEFINED) {\r
//\r
// <input file="${DEST_DIR_OUTPUT}\Bds.pe32"/>\r
//\r
Element ele = doc.createElement("input");\r
if (fileName == null) {\r
- ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+ ele.setAttribute("file", getSectionFile(basename, type));\r
} else {\r
ele.setAttribute("file", fileName);\r
}\r
//\r
Element ele = doc.createElement("sectFile");\r
if (fileName == null) {\r
- ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+ ele.setAttribute("fileName", getSectionFile(basename, type));\r
} else {\r
ele.setAttribute("fileName", fileName);\r
}\r
@param type Section type\r
@return Corresponding section file extension\r
**/\r
- private String getSectionExt(String type) {\r
+ private String getSectionFile(String basename, String type) {\r
+ for (int i = 0; i < sectionExt.length; i++) {\r
+ if (sectionExt[i][0].equalsIgnoreCase(type)) {\r
+ return "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + sectionExt[i][1];\r
+ }\r
+ }\r
+ return type;\r
+ }\r
+\r
+ private boolean isSectionType(String type) {\r
for (int i = 0; i < sectionExt.length; i++) {\r
if (sectionExt[i][0].equalsIgnoreCase(type)) {\r
- return sectionExt[i][1];\r
+ return true;\r
}\r
}\r
- return ".sec";\r
+ return false;\r
}\r
\r
/**\r