]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java
moved exception and logger classes to org.tianocore.common package
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / SplitfileTask.java
index b3f813cb097f1035050ae144675879ae1bb8c55a..a71eb013239fd4002f0a67b6646daf1d61b087b5 100644 (file)
@@ -1,16 +1,16 @@
 /** @file\r
  SplitfileTask class.\r
 \r
- SplitfileTask is used to call splitfile.exe to split input file to 2 output \r
+ SplitfileTask is used to call splitfile.exe to split input file to 2 output\r
  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
@@ -25,12 +25,13 @@ 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
   SplitfileTask class.\r
 \r
-  SplitfileTask is used to call splitfile.exe to split input file to 2 output \r
+  SplitfileTask is used to call splitfile.exe to split input file to 2 output\r
   file.\r
 **/\r
 public class SplitfileTask extends Task implements EfiDefine {\r
@@ -44,26 +45,26 @@ public class SplitfileTask extends Task implements EfiDefine {
     ///\r
     private String offset = "";\r
 \r
-  \r
+\r
     /**\r
      * execute\r
-     * \r
+     *\r
      * SplitfleTask 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
 \r
         Project project = this.getOwningTarget().getProject();\r
-        \r
+\r
         //\r
         // set Logger\r
         //\r
         FrameworkLogger logger = new FrameworkLogger(project, "splitfile");\r
         EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
         EdkLog.setLogger(logger);\r
-        \r
+\r
         //\r
         // absolute path of efi tools\r
         //\r
@@ -75,12 +76,12 @@ public class SplitfileTask extends Task implements EfiDefine {
         } else {\r
             command = path + File.separatorChar + "SplitFile";\r
         }\r
-        \r
+\r
         //\r
         // argument of tools\r
         //\r
         argument = inputFile + " " + offset;\r
-        \r
+\r
         //\r
         // return value of fwimage execution\r
         //\r
@@ -97,23 +98,21 @@ public class SplitfileTask extends Task implements EfiDefine {
 \r
             runner.setAntRun(project);\r
             runner.setCommandline(cmdline.getCommandline());\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.inputFile)).getName());\r
             revl = runner.execute();\r
             if (EFI_SUCCESS == revl) {\r
                 //\r
                 // command execution success\r
                 //\r
-                EdkLog.log(EdkLog.EDK_INFO, "splitfile succeeded!");\r
+                EdkLog.log(EdkLog.EDK_VERBOSE, "SplitFile succeeded!");\r
             } else {\r
                 //\r
                 // command execution fail\r
                 //\r
-                EdkLog.log(EdkLog.EDK_ERROR, "splitfile failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-                throw new BuildException("splitfile failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-\r
+                EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));\r
+                throw new BuildException("SplitFile failed!");\r
             }\r
         } catch (Exception e) {\r
             throw new BuildException(e.getMessage());\r
@@ -122,9 +121,9 @@ public class SplitfileTask extends Task implements EfiDefine {
 \r
     /**\r
      * getInputFile\r
-     * \r
+     *\r
      * This function is to get class member "inputFile".\r
-     * \r
+     *\r
      * @return string of input file name.\r
      */\r
     public String getInputFile() {\r
@@ -133,9 +132,9 @@ public class SplitfileTask extends Task implements EfiDefine {
 \r
     /**\r
      * setComponentType\r
-     * \r
+     *\r
      * This function is to set class member "inputFile".\r
-     * \r
+     *\r
      * @param inputFile\r
      *            string of input file name.\r
      */\r
@@ -145,9 +144,9 @@ public class SplitfileTask extends Task implements EfiDefine {
 \r
     /**\r
       getOffset\r
-      \r
+\r
       This function is to get class member "offset"\r
-      \r
+\r
       @return offset value of string.\r
     **/\r
     public String getOffset() {\r
@@ -156,14 +155,14 @@ public class SplitfileTask extends Task implements EfiDefine {
 \r
     /**\r
       setOffset\r
-      \r
+\r
       This function is to set class member "offset"\r
-      \r
+\r
       @param offset\r
                  string of offset value.\r
     **/\r
     public void setOffset(String offset) {\r
         this.offset = offset;\r
     }\r
-    \r
+\r
 }\r