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.taskdefs.Execute;\r
-import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
-import org.apache.tools.ant.types.Commandline;\r
\r
import java.io.File;\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
import java.io.InputStreamReader;\r
import java.lang.ProcessBuilder;\r
-import java.util.ArrayList;\r
import java.util.LinkedList;\r
-import java.util.List;\r
-import java.util.Map;\r
\r
/**\r
GenFvImageTask\r
///\r
private String infFile="";\r
///\r
- /// The target architecture.\r
- ///\r
- private String arch="";\r
- ///\r
/// Output directory\r
///\r
private String outputDir = ".";\r
**/\r
public void execute() throws BuildException {\r
Project project = this.getOwningTarget().getProject();\r
- String path = project.getProperty("env.Framework_Tools_Path");\r
+ String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
+\r
if (path == null) {\r
path = "";\r
} else {\r
path += File.separatorChar;\r
}\r
+ argList.addFirst(path + toolName);\r
\r
- if (arch != null && arch.length() > 0) {\r
- argList.addFirst(path + toolName + "_" + arch);\r
- } else {\r
- argList.addFirst(path + toolName);\r
- }\r
-\r
- ///\r
/// lauch the program\r
///\r
ProcessBuilder pb = new ProcessBuilder(argList);\r
pb.directory(new File(outputDir));\r
int exitCode = 0;\r
+ log((new File(this.infFile)).getName());\r
try {\r
Process cmdProc = pb.start();\r
InputStreamReader cmdOut = new InputStreamReader(cmdProc.getInputStream());\r
exitCode = cmdProc.waitFor();\r
if (exitCode != 0) {\r
int len = cmdOut.read(buf, 0, 1024);\r
- log(new String(buf, 0, len), Project.MSG_ERR);\r
+ log(new String(buf, 0, len));\r
} else {\r
- log("GenFvImage - DONE!", Project.MSG_VERBOSE);\r
+ log("GenFvImage succeeded!", Project.MSG_VERBOSE);\r
}\r
} catch (Exception e) {\r
throw new BuildException(e.getMessage());\r
} finally {\r
if (exitCode != 0) {\r
- throw new BuildException("GenFvImage: failed to generate FV file!");\r
+ //throw new BuildException("GenFvImage: failed to generate FV file!");\r
}\r
}\r
\r
argList.add(infFile);\r
}\r
\r
- /**\r
- getArch\r
- \r
- This function is to get class member of arch.\r
- @return The target architecture.\r
- **/\r
- public String getArch() {\r
- return arch;\r
- }\r
- \r
- /**\r
- setArch\r
- \r
- This function is to set class member of arch. \r
- \r
- @param arch The target architecture.\r
- **/\r
- public void setArch(String arch) {\r
- this.arch = arch;\r
- }\r
-\r
/**\r
getOutputDir\r
\r
public void setOutputDir(String outputDir) {\r
this.outputDir = outputDir;\r
}\r
-}
\ No newline at end of file
+}\r