X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkTasks%2Forg%2Ftianocore%2Fframework%2Ftasks%2FVfrCompilerTask.java;h=3d940cb29762e313b03c23149b03a3f1e69a060e;hp=cf2fe1e476218eb85e0bae4a07f5b9da9cecb7dd;hb=caa44816ddcbc71cb820260f4df8065806cdf285;hpb=2da8968bb588b2bf72501a90597b8de464394024 diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java index cf2fe1e476..3d940cb297 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ package org.tianocore.framework.tasks; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -37,9 +38,11 @@ import org.apache.tools.ant.types.Commandline; public class VfrCompilerTask extends Task implements EfiDefine { private String createListFile = ""; private String outPutDir = ""; + private File outPutFile; private String createIfrBinFile = ""; private String processerArg =""; - private String vfrFile; + private String vfrFile = ""; + private String vfrFileName = ""; private List includepathList = new ArrayList(); @@ -77,6 +80,9 @@ public class VfrCompilerTask extends Task implements EfiDefine { @param outPutDir The directory name for ouput file **/ public void setOutPutDir(String outPutDir) { + if (outPutDir != null) { + outPutFile = new File(outPutDir); + } this.outPutDir = " -od " + outPutDir; } @@ -116,6 +122,7 @@ public class VfrCompilerTask extends Task implements EfiDefine { @param vfrFile The name of VFR file **/ public void setVfrFile(String vfrFile) { + this.vfrFileName = (new File(vfrFile)).getName(); this.vfrFile = " " + vfrFile; } @@ -201,21 +208,24 @@ public class VfrCompilerTask extends Task implements EfiDefine { Execute runner = new Execute(streamHandler,null); runner.setAntRun(project); + runner.setCommandline(commandLine.getCommandline()); + + if (outPutFile != null && outPutFile.exists()) { + runner.setWorkingDirectory(outPutFile); + } - System.out.println(Commandline.toString(commandLine.getCommandline())); + log(Commandline.toString(commandLine.getCommandline()), Project.MSG_VERBOSE); + log(vfrFileName); int returnVal = runner.execute(); if (EFI_SUCCESS == returnVal) { - System.out.println("VfrCompiler execution succeeded!"); + log("VfrCompile succeeded!", Project.MSG_VERBOSE); } else { - System.out.println("VfrCompiler failed. (error=" + - Integer.toHexString(returnVal) + ")"); - throw new BuildException("VfrCompiler failed. (error=" + - Integer.toHexString(returnVal) + ")"); + log("ERROR = " + Integer.toHexString(returnVal)); + throw new BuildException("VfrCompile failed!"); } - } catch (IOException e) { throw new BuildException(e.getMessage()); } } -} \ No newline at end of file +}