**/\r
public class Tool implements EfiDefine, Section {\r
\r
- String toolName = "";\r
- List<Object> toolArgList = new ArrayList<Object>();\r
- String outputPath;\r
- File outputFile ;\r
- List<Input> inputFiles = new ArrayList<Input>();\r
- List<Section> gensectList = new ArrayList<Section>();\r
- String inputArg = "-i ";\r
+ private String toolName = "";\r
+ private ToolArg toolArgList = new ToolArg();\r
+ private Input inputFiles = new Input();\r
+ private String outputPath;\r
+ private File outputFile ;\r
+ private List<Section> gensectList = new ArrayList<Section>();\r
/**\r
Call extern tool\r
\r
String command = "";\r
String argument = "";\r
command = toolName;\r
- Iterator argIter = toolArgList.iterator();\r
- Iterator inputIter = inputFiles.iterator();\r
- ToolArg toolArg;\r
- Input file = null;\r
- \r
\r
//\r
// Get each section which under the compress {};\r
//\r
// Parse <genSection> element\r
//\r
- File outputFile = File.createTempFile("temp", "sec1",new File(outputPath));\r
+ File outputFile = File.createTempFile("temp", "sec1", new File(outputPath));\r
FileOutputStream bo = new FileOutputStream(outputFile);\r
DataOutputStream Do = new DataOutputStream (bo);\r
//\r
throw new BuildException ("GenSection failed at Tool!");\r
} \r
Do.close();\r
- this.inputArg += outputFile.getPath() + " "; \r
+ this.inputFiles.insFile(outputFile.getPath()); \r
} \r
} catch (IOException e){\r
throw new BuildException ("Gensection failed at tool!");\r
}\r
\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
- while (inputIter.hasNext()) {\r
- file = (Input)inputIter.next();\r
- inputArg += file.toString(" ");\r
- }\r
try {\r
outputFile = File.createTempFile("temp", null, new File(outputPath));\r
- argument = argument + inputArg + " -o " + outputFile.getPath();\r
- EdkLog.log(EdkLog.EDK_INFO, argument);\r
+ argument = toolArgList + inputFiles.toStringWithSinglepPrefix(" -i ") \r
+ + " -o " + outputFile.getPath();\r
+ EdkLog.log(this, EdkLog.EDK_VERBOSE, command + " " + argument);\r
///\r
/// execute command line\r
///\r
\r
@param toolArg The ToolArg object containing arguments for the tool\r
**/\r
- public void addToolArg (ToolArg toolArg) {\r
- toolArgList.add (toolArg);\r
+ public void addConfiguredToolArg (ToolArg toolArg) {\r
+ toolArgList.insert(toolArg);\r
}\r
\r
/**\r
\r
@param file The Input objec which represents a file\r
**/\r
- public void addInput(Input file) {\r
- inputFiles.add(file);\r
+ public void addConfiguredInput(Input file) {\r
+ inputFiles.insert(file);\r
}\r
\r
// /**\r
\r
public void addGenSection(GenSectionTask genSect){\r
this.gensectList.add(genSect);\r
- }\r
- \r
+ } \r
}\r
\r
\r