\r
package org.tianocore.framework.tasks;\r
\r
+import java.io.File;\r
+\r
+import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.Project;\r
import org.apache.tools.ant.Task;\r
-import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.taskdefs.Execute;\r
import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
import org.apache.tools.ant.types.Commandline;\r
///\r
private String inputFile = "";\r
///\r
+ /// \r
+ /// \r
+ private String inputFileName = "";\r
+ ///\r
/// outputfile name\r
///\r
private String outputFile = "";\r
//\r
String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
if (path == null) {\r
- command = "gensection";\r
+ command = "GenSection";\r
} else {\r
- command = path + "/" + "gensection";\r
+ command = path + "/" + "GenSection";\r
}\r
//\r
// argument of tools\r
\r
runner.setAntRun(project);\r
runner.setCommandline(cmdline.getCommandline());\r
- System.out.println(Commandline.toString(cmdline.getCommandline()));\r
\r
+ log(inputFileName);\r
+ log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE);\r
revl = runner.execute();\r
if (EFI_SUCCESS == revl) {\r
- //\r
- // command execution success\r
- //\r
- System.out.println("gensection successed!");\r
+ log("gensection succeeded!", Project.MSG_VERBOSE);\r
} else {\r
//\r
// command execution fail\r
//\r
- System.out.println("gensection failed. (error="\r
- + Integer.toHexString(revl) + ")");\r
- throw new BuildException("gensection failed. (error="\r
- + Integer.toHexString(revl) + ")");\r
+ log("ERROR = " + Integer.toHexString(revl));\r
+ throw new BuildException("gensection failed!");\r
}\r
} catch (Exception e) {\r
throw new BuildException(e.getMessage());\r
@param inputFile name of input file\r
**/\r
public void setInputFile(String inputFile) {\r
+ this.inputFileName = (new File(inputFile)).getName();\r
this.inputFile = " -i " + inputFile;\r
}\r
\r