import java.util.LinkedHashSet;\r
import java.util.Map;\r
import java.util.Set;\r
+import java.io.FileOutputStream;\r
+import java.io.OutputStreamWriter;\r
\r
import javax.xml.parsers.DocumentBuilder;\r
import javax.xml.parsers.DocumentBuilderFactory;\r
// generate all directory path\r
//\r
(new File(file.getParent())).mkdirs();\r
- Result result = new StreamResult(file);\r
+ FileOutputStream outputStream = new FileOutputStream(file);\r
+ Result result = new StreamResult(new OutputStreamWriter(outputStream));\r
\r
//\r
// Write the DOM document to the file\r
@param root Root element for current\r
**/\r
private void applyCleanElement(Document document, Node root) {\r
- ModuleIdentification[] libinstances = SurfaceAreaQuery.getLibraryInstance(fpdModuleId.getArch());\r
- for (int i = 0; i < libinstances.length; i++) {\r
- //\r
- // Put package file path to module identification\r
- //\r
- PackageIdentification packageId = libinstances[i].getPackage();\r
- \r
- //\r
- // Generate ANT script to clean\r
- //\r
- Element ele = document.createElement("GenBuild");\r
- ele.setAttribute("type", "clean");\r
- \r
- //\r
- // Prepare pass down information\r
- //\r
- Map<String, String> passDownMap = new LinkedHashMap<String, String>();\r
- for (int j = 0; j < inheritProperties.length; j ++){\r
- passDownMap.put(inheritProperties[j], "${" + inheritProperties[j] + "}");\r
- }\r
- passDownMap.put("MODULE_GUID", libinstances[i].getGuid());\r
- passDownMap.put("MODULE_VERSION", libinstances[i].getVersion());\r
- \r
- passDownMap.put("PACKAGE_GUID", packageId.getGuid());\r
- passDownMap.put("PACKAGE_VERSION", packageId.getVersion());\r
- \r
- for (int j = 0; j < inheritProperties.length; j ++){\r
- Element property = document.createElement("property");\r
- property.setAttribute("name", inheritProperties[j]);\r
- property.setAttribute("value", passDownMap.get(inheritProperties[j]));\r
- ele.appendChild(property);\r
- }\r
-\r
- root.appendChild(ele);\r
- }\r
//\r
// <delete includeemptydirs="true">\r
// <fileset dir="${DEST_DIR_OUTPUT}" includes="" excludes="" />\r
@param root Root element for current\r
**/\r
private void applyDeepcleanElement(Document document, Node root) {\r
- ModuleIdentification[] libinstances = SurfaceAreaQuery.getLibraryInstance(fpdModuleId.getArch());\r
- for (int i = 0; i < libinstances.length; i++) {\r
- //\r
- // Put package file path to module identification\r
- //\r
- PackageIdentification packageId = libinstances[i].getPackage();\r
- \r
- //\r
- // Generate ANT script to clean\r
- //\r
- Element ele = document.createElement("GenBuild");\r
- ele.setAttribute("type", "cleanall");\r
- \r
- //\r
- // Prepare pass down information\r
- //\r
- Map<String, String> passDownMap = new LinkedHashMap<String, String>();\r
- for (int j = 0; j < inheritProperties.length; j ++){\r
- passDownMap.put(inheritProperties[j], "${" + inheritProperties[j] + "}");\r
- }\r
- \r
- passDownMap.put("MODULE_GUID", libinstances[i].getGuid());\r
- passDownMap.put("MODULE_VERSION", libinstances[i].getVersion());\r
- \r
- passDownMap.put("PACKAGE_GUID", packageId.getGuid());\r
- passDownMap.put("PACKAGE_VERSION", packageId.getVersion());\r
- \r
- for (int j = 0; j < inheritProperties.length; j ++){\r
- Element property = document.createElement("property");\r
- property.setAttribute("name", inheritProperties[j]);\r
- property.setAttribute("value", passDownMap.get(inheritProperties[j]));\r
- ele.appendChild(property);\r
- }\r
-\r
- root.appendChild(ele);\r
- }\r
//\r
// <delete includeemptydirs="true">\r
// <fileset dir="${DEST_DIR_OUTPUT}" includes="" excludes="" />\r
**/\r
private void applyLibraryInstance(Document document, Node root) {\r
ModuleIdentification[] libinstances = SurfaceAreaQuery.getLibraryInstance(fpdModuleId.getArch());\r
-// String propertyLibs = "";\r
for (int i = 0; i < libinstances.length; i++) {\r
//\r
// Put package file path to module identification\r
//\r
Element ele = document.createElement("GenBuild");\r
ele.setAttribute("type", "build");\r
-// ele.setAttribute("inheritAll", "false");\r
\r
//\r
// Prepare pass down information\r
}\r
\r
root.appendChild(ele);\r
-// propertyLibs += " " + project.getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";\r
}\r
-// project.setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));\r
}\r
\r
/**\r
//\r
// WORKSPACE\r
//\r
- includes.add("${WORKSPACE_DIR}");\r
+ includes.add("${WORKSPACE_DIR}" + File.separatorChar);\r
\r
//\r
// Module iteself\r