- Iterator argIter = toolArgList.iterator();\r
- Iterator inputIter = inputFiles.iterator();\r
- ToolArg toolArg;\r
- Input file = null;\r
-\r
- ///\r
- /// argument of tools\r
- ///\r
- while (argIter.hasNext()) {\r
- toolArg = (ToolArg)argIter.next();\r
- argument = argument + toolArg.getLine() + " ";\r
-\r
- }\r
-\r
- ///\r
- /// input files for tools\r
- ///\r
- argument = argument + "-i ";\r
- while (inputIter.hasNext()) {\r
- file = (Input)inputIter.next();\r
- argument = argument + file.getFile() + " ";\r
- }\r
-\r
- outPutFileName = outputPath + File.separatorChar + (new File(file.getFile())).getName() + ".crc";\r
- argument = argument + " -o " + outPutFileName; \r
+ \r
+ //\r
+ // Get each section which under the compress {};\r
+ // And add it is contains to File;\r
+ //\r
+ Section sect;\r
+ try{\r
+ Iterator SectionIter = this.gensectList.iterator();\r
+ while (SectionIter.hasNext()){\r
+ sect = (Section)SectionIter.next();\r
+ //\r
+ // Parse <genSection> element\r
+ //\r
+ File outputFile = File.createTempFile("temp", "sec1", new File(outputPath));\r
+ FileOutputStream bo = new FileOutputStream(outputFile);\r
+ DataOutputStream Do = new DataOutputStream (bo);\r
+ //\r
+ // Call each section class's toBuffer function.\r
+ //\r
+ try {\r
+ sect.toBuffer(Do);\r
+ }\r
+ catch (BuildException e) {\r
+ EdkLog.log(e.getMessage());\r
+ throw new BuildException ("GenSection failed at Tool!");\r
+ } finally {\r
+ if (Do != null){\r
+ Do.close(); \r
+ }\r
+ \r
+ } \r
+ this.tempInputFile.insFile(outputFile.getPath());\r
+ } \r
+ } catch (IOException e){\r
+ throw new BuildException ("Gensection failed at tool!");\r
+ } \r