* SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
*/\r
public class SecFixupTask extends Task implements EfiDefine {\r
- // /\r
- // / tool name\r
- // /\r
+ //\r
+ // tool name\r
+ //\r
private String toolName = "SecFixup";\r
\r
- // /\r
- // / input file\r
- // /\r
- private String secExeFile = "";\r
+ //\r
+ // input file\r
+ //\r
+ private FileArg secExeFile = new FileArg();\r
\r
- // /\r
- // / output file\r
- // /\r
- private String resetVectorDataFile = "";\r
+ //\r
+ // output file\r
+ //\r
+ private FileArg resetVectorDataFile = new FileArg();\r
\r
- // /\r
- // / output directory, this variable is added by jave wrap\r
- // /\r
- private String outputFile = "";\r
+ //\r
+ // output file\r
+ //\r
+ private FileArg outputFile = new FileArg();\r
\r
- // /\r
- // / output directory\r
- // /\r
- private String outputDir = "";\r
+ //\r
+ // output directory, this variable is added by jave wrap\r
+ //\r
+ private String outputDir = ".";\r
\r
/**\r
- * execute\r
- *\r
- * SecFixupTask execute function is to assemble tool command line & execute\r
- * tool command line\r
- *\r
- * @throws BuidException\r
- */\r
+ execute\r
+ \r
+ SecFixupTask 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
//\r
// argument of tools\r
//\r
- if (!this.outputDir.equalsIgnoreCase("")) {\r
- argument = this.secExeFile + " " + this.resetVectorDataFile + " "\r
- + this.outputDir + File.separatorChar + this.outputFile;\r
- } else {\r
- argument = this.secExeFile + " " + this.resetVectorDataFile + " "\r
- + this.outputFile;\r
- }\r
+ argument = "" + secExeFile + resetVectorDataFile + outputFile;\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
//\r
// Set debug log information.\r
//\r
EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
+ EdkLog.log(this, EdkLog.EDK_INFO, secExeFile.toFileList() \r
+ + resetVectorDataFile.toFileList() + " => " + outputFile.toFileList());\r
\r
revl = runner.execute();\r
\r
//\r
// command execution success\r
//\r
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "SecFixup 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("SecFixup failed!");\r
+ throw new BuildException(toolName + " failed!");\r
}\r
} catch (Exception e) {\r
throw new BuildException(e.getMessage());\r
}\r
\r
/**\r
- * getSecExeFile\r
- *\r
- * This function is to get class member "secExeFile".\r
- *\r
- * @return string of sectExe file name.\r
- */\r
+ getSecExeFile\r
+ \r
+ This function is to get class member "secExeFile".\r
+ \r
+ @return string of sectExe file name.\r
+ **/\r
public String getSecExeFile() {\r
- return this.secExeFile;\r
+ return this.secExeFile.getValue();\r
}\r
\r
/**\r
- * setSecExeFile\r
- *\r
- * This function is to set class member "secExeFile".\r
- *\r
- * @param secExeFile\r
- * string of secExe file name.\r
- */\r
+ setSecExeFile\r
+ \r
+ This function is to set class member "secExeFile".\r
+ \r
+ @param secExeFile\r
+ string of secExe file name.\r
+ **/\r
public void setSecExeFile(String secExeFile) {\r
- this.secExeFile = secExeFile;\r
+ this.secExeFile.setArg(" ", secExeFile);\r
}\r
\r
/**\r
- * getResetVectorDataFile\r
- *\r
- * This function is to get class member "resetVectorDataFile"\r
- *\r
- * @return resetVectorDataFile string of resetVectorData file name.\r
- */\r
+ getResetVectorDataFile\r
+ \r
+ This function is to get class member "resetVectorDataFile"\r
+ \r
+ @return resetVectorDataFile string of resetVectorData file name.\r
+ **/\r
public String getResetVectorDataFile() {\r
- return this.resetVectorDataFile;\r
+ return this.resetVectorDataFile.getValue();\r
}\r
\r
/**\r
- * setResetVectorDataFile\r
- *\r
- * This function is to set class member "resetVectorDataFile"\r
- *\r
- * @param resetVectorDataFile\r
- * string of resetVectorData file name.\r
- */\r
+ setResetVectorDataFile\r
+ \r
+ This function is to set class member "resetVectorDataFile"\r
+ \r
+ @param resetVectorDataFile\r
+ string of resetVectorData file name.\r
+ **/\r
public void setResetVectorDataFile(String resetVectorDataFile) {\r
- this.resetVectorDataFile = resetVectorDataFile;\r
+ this.resetVectorDataFile.setArg(" ", resetVectorDataFile);\r
}\r
\r
/**\r
- * getOutputFile\r
- *\r
- * This function is to get class member "outputFile"\r
- *\r
- * @return outputFile string of output file name.\r
- */\r
+ getOutputFile\r
+ \r
+ This function is to get class member "outputFile"\r
+ \r
+ @return outputFile string of output file name.\r
+ **/\r
public String getOutputFile() {\r
- return outputFile;\r
+ return this.outputFile.getValue();\r
}\r
\r
/**\r
- * setOutputFile\r
- *\r
- * This function is to set class member "outputFile"\r
- *\r
- * @param outputFile\r
- * string of output file name.\r
- */\r
+ setOutputFile\r
+ \r
+ This function is to set class member "outputFile"\r
+ \r
+ @param outputFile\r
+ string of output file name.\r
+ **/\r
public void setOutputFile(String outputFile) {\r
- this.outputFile = outputFile;\r
+ this.outputFile.setArg(" ", outputFile);\r
}\r
\r
/**\r
- * getOutputDir\r
- *\r
- * This function is to get class member "outputDir"\r
- *\r
- * @return outputDir name of output directory\r
- */\r
+ getOutputDir\r
+ \r
+ This function is to get class member "outputDir"\r
+ \r
+ @return outputDir name 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
- * name of output directory\r
- */\r
+ setOutputDir\r
+ \r
+ This function is to set class member "outputDir"\r
+ \r
+ @param outputDir\r
+ name of output directory\r
+ **/\r
public void setOutputDir(String outputDir) {\r
this.outputDir = outputDir;\r
}\r