]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java
Polished the build tools' screen output to be in a more coherent form
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / GenSectionTask.java
index 1741d867b813cdaa471ef1ff4770ce8f4c0f0b4d..25328a12d87f7bd31bf0e5d06fb7909cfa18c36f 100644 (file)
 \r
 package org.tianocore.framework.tasks;\r
 \r
+import java.io.File;\r
+\r
+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.BuildException;\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
@@ -29,6 +31,10 @@ public class GenSectionTask extends Task implements EfiDefine {
     ///\r
     private String inputFile = "";\r
     ///\r
+    /// \r
+    /// \r
+    private String inputFileName = "";\r
+    ///\r
     /// outputfile name\r
     ///\r
     private String outputFile = "";\r
@@ -61,9 +67,9 @@ public class GenSectionTask extends Task implements EfiDefine {
         //\r
         String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         if (path == null) {\r
-            command = "gensection";\r
+            command = "GenSection";\r
         } else {\r
-            command = path + "/" + "gensection";\r
+            command = path + "/" + "GenSection";\r
         }\r
         //\r
         // argument of tools\r
@@ -86,22 +92,18 @@ public class GenSectionTask extends Task implements EfiDefine {
 \r
             runner.setAntRun(project);\r
             runner.setCommandline(cmdline.getCommandline());\r
-            System.out.println(Commandline.toString(cmdline.getCommandline()));\r
 \r
+            log(inputFileName);\r
+            log(Commandline.toString(cmdline.getCommandline()), Project.MSG_VERBOSE);\r
             revl = runner.execute();\r
             if (EFI_SUCCESS == revl) {\r
-                //\r
-                // command execution success\r
-                //\r
-                System.out.println("gensection succeeded!");\r
+                log("gensection succeeded!", Project.MSG_VERBOSE);\r
             } else {\r
                 //\r
                 // command execution fail\r
                 //\r
-                System.out.println("gensection failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-                throw new BuildException("gensection failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
+                log("ERROR = " + Integer.toHexString(revl));\r
+                throw new BuildException("gensection failed!");\r
             }\r
         } catch (Exception e) {\r
             throw new BuildException(e.getMessage());\r
@@ -127,6 +129,7 @@ public class GenSectionTask extends Task implements EfiDefine {
       @param inputFile            name of input file\r
     **/\r
     public void setInputFile(String inputFile) {\r
+        this.inputFileName = (new File(inputFile)).getName();\r
         this.inputFile = " -i " + inputFile;\r
     }\r
 \r