X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkTasks%2Forg%2Ftianocore%2Fframework%2Ftasks%2FFwImageTask.java;h=1021f1afe68f1c68e7a941d066171fce34bc4b0f;hp=48262e543c743230821c6424c967a0b78d25a194;hb=219e2247478e46f81b744252b13cd1df01a76756;hpb=878ddf1fc3540a715f63594ed22b6929e881afb4 diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java index 48262e543c..1021f1afe6 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java @@ -16,12 +16,16 @@ **/ package org.tianocore.framework.tasks; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.Project; +import java.io.File; + import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.types.Commandline; +import org.tianocore.logger.EdkLog; + /** FwImageTask class. @@ -37,6 +41,7 @@ public class FwImageTask extends Task implements EfiDefine{ /// input PE image /// private String peImage = ""; + private String peImageName = ""; /// /// output EFI image /// @@ -65,12 +70,12 @@ public class FwImageTask extends Task implements EfiDefine{ // // absolute path of efi tools // - String path = project.getProperty("env.Framework_Tools_Path"); + String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH"); String command; if (path == null) { - command = "fwimage"; + command = "FwImage"; } else { - command = path + "/" + "fwimage"; + command = path + "/" + "FwImage"; } // // argument of tools @@ -92,23 +97,18 @@ public class FwImageTask extends Task implements EfiDefine{ runner.setAntRun(project); runner.setCommandline(cmdline.getCommandline()); - System.out.println(Commandline.toString(cmdline.getCommandline())); + log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE); + log(this.peImageName); revl = runner.execute(); if (EFI_SUCCESS == revl) { - // - // command execution success - // - System.out.println("fwimage successed!"); + log("fwimage succeeded!", Project.MSG_VERBOSE); } else { // // command execution fail // - System.out.println("fwimage failed. (error=" - + Integer.toHexString(revl) + ")"); - throw new BuildException("fwimage failed. (error=" - + Integer.toHexString(revl) + ")"); - + log("ERROR = " + Integer.toHexString(revl)); + throw new BuildException("fwimage failed!"); } } catch (Exception e) { throw new BuildException(e.getMessage()); @@ -153,6 +153,7 @@ public class FwImageTask extends Task implements EfiDefine{ @param peImage name of PE image **/ public void setPeImage(String peImage) { + this.peImageName = (new File(peImage)).getName(); this.peImage = " " + peImage; }