X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkTasks%2Forg%2Ftianocore%2Fframework%2Ftasks%2FGenFvImageTask.java;h=d0c4c5b637f9e881e8a25e0be27bb7e2cb5f57f0;hp=6f3cd7bd7b8c9afe49868547ee633a321af70ef5;hb=c59963f51b2c394c2c5d20f910b697770b506936;hpb=d05003bed6b96ad51fbf5d9b7b6c2897e6228245 diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java index 6f3cd7bd7b..d0c4c5b637 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java @@ -18,19 +18,11 @@ package org.tianocore.framework.tasks; 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 java.io.File; -import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.lang.ProcessBuilder; -import java.util.ArrayList; import java.util.LinkedList; -import java.util.List; -import java.util.Map; /** GenFvImageTask @@ -48,10 +40,6 @@ public class GenFvImageTask extends Task implements EfiDefine{ /// private String infFile=""; /// - /// The target architecture. - /// - private String arch=""; - /// /// Output directory /// private String outputDir = "."; @@ -68,25 +56,21 @@ public class GenFvImageTask extends Task implements EfiDefine{ **/ public void execute() throws BuildException { Project project = this.getOwningTarget().getProject(); - String path = project.getProperty("env.Framework_Tools_Path"); + String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH"); + if (path == null) { path = ""; } else { path += File.separatorChar; } + argList.addFirst(path + toolName); - if (arch != null && arch.length() > 0) { - argList.addFirst(path + toolName + "_" + arch); - } else { - argList.addFirst(path + toolName); - } - - /// /// lauch the program /// ProcessBuilder pb = new ProcessBuilder(argList); pb.directory(new File(outputDir)); int exitCode = 0; + log((new File(this.infFile)).getName()); try { Process cmdProc = pb.start(); InputStreamReader cmdOut = new InputStreamReader(cmdProc.getInputStream()); @@ -95,9 +79,9 @@ public class GenFvImageTask extends Task implements EfiDefine{ exitCode = cmdProc.waitFor(); if (exitCode != 0) { int len = cmdOut.read(buf, 0, 1024); - log(new String(buf, 0, len), Project.MSG_ERR); + log(new String(buf, 0, len)); } else { - log("GenFvImage - DONE!", Project.MSG_VERBOSE); + log("GenFvImage succeeded!", Project.MSG_VERBOSE); } } catch (Exception e) { throw new BuildException(e.getMessage()); @@ -131,27 +115,6 @@ public class GenFvImageTask extends Task implements EfiDefine{ argList.add(infFile); } - /** - getArch - - This function is to get class member of arch. - @return The target architecture. - **/ - public String getArch() { - return arch; - } - - /** - setArch - - This function is to set class member of arch. - - @param arch The target architecture. - **/ - public void setArch(String arch) { - this.arch = arch; - } - /** getOutputDir @@ -173,4 +136,4 @@ public class GenFvImageTask extends Task implements EfiDefine{ public void setOutputDir(String outputDir) { this.outputDir = outputDir; } -} \ No newline at end of file +}