public class VfrCompilerTask extends Task implements EfiDefine {\r
private String createListFile = "";\r
private String outPutDir = "";\r
+ private File outPutFile;\r
private String createIfrBinFile = "";\r
private String processerArg ="";\r
private String vfrFile = "";\r
private String vfrFileName = "";\r
\r
- private List<Object> includepathList = new ArrayList<Object>();\r
+ private List<IncludePath> includepathList = new ArrayList<IncludePath>();\r
\r
/**\r
get class member of createList file\r
@param outPutDir The directory name for ouput file\r
**/\r
public void setOutPutDir(String outPutDir) {\r
+ if (outPutDir != null) {\r
+ outPutFile = new File(outPutDir);\r
+ }\r
this.outPutDir = " -od " + outPutDir;\r
}\r
\r
List<Object> includePath = new ArrayList<Object>(); \r
String incPath = ""; \r
\r
- int count = includepathList.size(); \r
- IncludePath path;\r
- for (int i = 0; i < count; i++) {\r
- path = (IncludePath) includepathList.get(i);\r
- if (path.getFile() != null) {\r
- FileParser.loadFile( project,includePath,path.getFile(), "-I"); \r
- }\r
- }\r
+ int count = includepathList.size(); \r
for (int i = 0; i < count; i++) {\r
- incPath = incPath + " " + includepathList.get(i);\r
- }\r
- count = includePath.size();\r
- for (int i = 0; i < count; i++) {\r
- incPath = incPath + " " + includePath.get(i);\r
+ incPath += includepathList.get(i).toString();\r
}\r
+\r
String argument = this.createIfrBinFile +\r
this.processerArg + \r
incPath +\r
\r
Execute runner = new Execute(streamHandler,null);\r
runner.setAntRun(project);\r
+ \r
runner.setCommandline(commandLine.getCommandline());\r
+ \r
+ if (outPutFile != null && outPutFile.exists()) {\r
+ runner.setWorkingDirectory(outPutFile); \r
+ }\r
\r
log(Commandline.toString(commandLine.getCommandline()), Project.MSG_VERBOSE);\r
log(vfrFileName);\r
int returnVal = runner.execute();\r
if (EFI_SUCCESS == returnVal) {\r
- log("VfrCompiler succeeded!", Project.MSG_VERBOSE);\r
+ log("VfrCompile succeeded!", Project.MSG_VERBOSE);\r
} else {\r
log("ERROR = " + Integer.toHexString(returnVal));\r
- throw new BuildException("VfrCompiler failed!");\r
+ throw new BuildException("VfrCompile failed!");\r
}\r
} catch (IOException e) {\r
throw new BuildException(e.getMessage());\r
}\r
}\r
-}
\ No newline at end of file
+}\r