file.\r
**/\r
public class SplitfileTask extends Task implements EfiDefine {\r
- ///\r
- /// input file\r
- ///\r
- private String inputFile = "";\r
-\r
- ///\r
- /// offset value\r
- ///\r
- private String offset = "";\r
-\r
+ //\r
+ // Tool name\r
+ // \r
+ private static String toolName = "SplitFile";\r
+\r
+ //\r
+ // input file\r
+ //\r
+ private FileArg inputFile = new FileArg();\r
+\r
+ //\r
+ // offset value\r
+ //\r
+ private ToolArg offset = new ToolArg();\r
+\r
+ //\r
+ // Output directory\r
+ // \r
+ private String outputDir = ".";\r
\r
/**\r
- * execute\r
- *\r
- * SplitfleTask execute function is to assemble tool command line & execute\r
- * tool command line\r
- *\r
- * @throws BuidException\r
- */\r
+ execute\r
+ \r
+ SplitfleTask execute function is to assemble tool command line & execute\r
+ tool command line\r
+ \r
+ @throws BuidException\r
+ **/\r
public void execute() throws BuildException {\r
\r
Project project = this.getOwningTarget().getProject();\r
String command;\r
String argument;\r
if (path == null) {\r
- command = "SplitFile";\r
+ command = toolName;\r
} else {\r
- command = path + File.separatorChar + "SplitFile";\r
+ command = path + File.separator + toolName;\r
}\r
\r
//\r
// argument of tools\r
//\r
- argument = inputFile + " " + offset;\r
+ argument = "" + inputFile + offset;\r
\r
//\r
// return value of fwimage execution\r
\r
runner.setAntRun(project);\r
runner.setCommandline(cmdline.getCommandline());\r
+ runner.setWorkingDirectory(new File(outputDir));\r
\r
EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
- EdkLog.log(this, EdkLog.EDK_INFO, (new File(this.inputFile)).getName());\r
+ String fileName = inputFile.toFileList();\r
+ EdkLog.log(this, EdkLog.EDK_INFO, fileName + " => " + fileName + "1 " + fileName + "2");\r
+\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
//\r
// command execution success\r
//\r
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "SplitFile succeeded!");\r
+ EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");\r
} else {\r
//\r
// command execution fail\r
//\r
EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));\r
- throw new BuildException("SplitFile failed!");\r
+ throw new BuildException(toolName + " failed!");\r
}\r
} catch (Exception e) {\r
throw new BuildException(e.getMessage());\r
}\r
\r
/**\r
- * getInputFile\r
- *\r
- * This function is to get class member "inputFile".\r
- *\r
- * @return string of input file name.\r
- */\r
+ getInputFile\r
+ \r
+ This function is to get class member "inputFile".\r
+ \r
+ @return string of input file name.\r
+ **/\r
public String getInputFile() {\r
- return inputFile;\r
+ return inputFile.getValue();\r
}\r
\r
/**\r
- * setComponentType\r
- *\r
- * This function is to set class member "inputFile".\r
- *\r
- * @param inputFile\r
- * string of input file name.\r
- */\r
+ setComponentType\r
+ \r
+ This function is to set class member "inputFile".\r
+ \r
+ @param inputFile\r
+ string of input file name.\r
+ **/\r
public void setInputFile(String inputFile) {\r
- this.inputFile = inputFile;\r
+ this.inputFile.setArg(" ", inputFile);\r
}\r
\r
/**\r
@return offset value of string.\r
**/\r
public String getOffset() {\r
- return offset;\r
+ return offset.getValue();\r
}\r
\r
/**\r
string of offset value.\r
**/\r
public void setOffset(String offset) {\r
- this.offset = offset;\r
+ this.offset.setArg(" ", offset);\r
+ }\r
+\r
+ /**\r
+ getOutputDir\r
+ \r
+ This function is to get class member "outputDir"\r
+ \r
+ @return outputDir string of output directory.\r
+ **/\r
+ public String getOutputDir() {\r
+ return outputDir;\r
}\r
\r
+ /**\r
+ setOutputDir\r
+ \r
+ This function is to set class member "outputDir"\r
+ \r
+ @param outputDir\r
+ string of output directory.\r
+ **/\r
+ public void setOutputDir(String outputDir) {\r
+ this.outputDir = outputDir;\r
+ }\r
}\r