]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java
moved exception and logger classes to org.tianocore.common package
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / CreateMtFileTask.java
index 07acafd25788b41d77ab40aa6bb37e40325a0dbe..d73ea6a9293d43d4b322d3885c66a82897e1ce3c 100644 (file)
@@ -2,14 +2,14 @@
  CreateMtFileTask class.\r
 \r
  CreateMtFileTask is used to call CreateMtFile.exe to create MT file.\r
\r
\r
+\r
+\r
  Copyright (c) 2006, Intel Corporation\r
  All rights reserved. This program and the accompanying materials\r
  are licensed and made available under the terms and conditions of the BSD License\r
  which accompanies this distribution.  The full text of the license may be found at\r
  http://opensource.org/licenses/bsd-license.php\r
\r
+\r
  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
@@ -24,7 +24,8 @@ import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.taskdefs.Execute;\r
 import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
 import org.apache.tools.ant.types.Commandline;\r
-import org.tianocore.logger.EdkLog;\r
+\r
+import org.tianocore.common.logger.EdkLog;\r
 \r
 /**\r
   CreateMtFileTask class.\r
@@ -53,10 +54,10 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * execute\r
-     * \r
+     *\r
      * StripTask execute function is to assemble tool command line & execute\r
      * tool command line\r
-     * \r
+     *\r
      * @throws BuidException\r
      */\r
     public void execute() throws BuildException {\r
@@ -85,7 +86,7 @@ public class CreateMtFileTask extends Task implements EfiDefine {
         File file = new File(outputFile);\r
         if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {\r
             argument = outputDir + File.separatorChar +  outputFile + " " + this.fileSize;\r
-                   \r
+\r
         } else {\r
             argument = outputFile  + " " + this.fileSize;\r
         }\r
@@ -108,24 +109,21 @@ public class CreateMtFileTask extends Task implements EfiDefine {
             //\r
             // Set debug log information.\r
             //\r
-            EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline.getCommandline()));\r
-            \r
+            EdkLog.log(EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
+            EdkLog.log(EdkLog.EDK_INFO, (new File(this.outputFile)).getName());\r
             revl = runner.execute();\r
-            \r
+\r
             if (EFI_SUCCESS == revl) {\r
                 //\r
                 // command execution success\r
                 //\r
-                EdkLog.log(EdkLog.EDK_INFO,"CreateMtFile succeeded!");\r
+                EdkLog.log(EdkLog.EDK_VERBOSE, "CreateMtFile succeeded!");\r
             } else {\r
                 //\r
                 // command execution fail\r
                 //\r
-                EdkLog.log(EdkLog.EDK_ERROR, "CreateMtFile failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-                throw new BuildException("CreateMtFile failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-\r
+                EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));\r
+                throw new BuildException("CreateMtFile failed!");\r
             }\r
         } catch (Exception e) {\r
             throw new BuildException(e.getMessage());\r
@@ -134,9 +132,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * getFileSize\r
-     * \r
+     *\r
      * This function is to get class member "fileSize".\r
-     * \r
+     *\r
      * @return fileSize       string of file size.\r
      */\r
     public String getFileSize() {\r
@@ -145,9 +143,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * setFileSize\r
-     * \r
+     *\r
      * This function is to set class member "fileSize".\r
-     * \r
+     *\r
      * @param fileSize\r
      *            string of file size value.\r
      */\r
@@ -157,9 +155,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * getOutputFile\r
-     * \r
+     *\r
      * This function is to get class member "outputFile"\r
-     * \r
+     *\r
      * @return outputFile string of output file name.\r
      */\r
     public String getOutputFile() {\r
@@ -168,9 +166,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * setOutputFile\r
-     * \r
+     *\r
      * This function is to set class member "outputFile"\r
-     * \r
+     *\r
      * @param outputFile\r
      *            string of output file name.\r
      */\r
@@ -180,9 +178,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * getOutputDir\r
-     * \r
+     *\r
      * This function is to get class member "outputDir"\r
-     * \r
+     *\r
      * @return outputDir string of output directory.\r
      */\r
     public String getOutputDir() {\r
@@ -191,9 +189,9 @@ public class CreateMtFileTask extends Task implements EfiDefine {
 \r
     /**\r
      * setOutputDir\r
-     * \r
+     *\r
      * This function is to set class member "outputDir"\r
-     * \r
+     *\r
      * @param outputDir\r
      *            string of output directory.\r
      */\r