]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / SecFixupTask.java
index 64c9295da4207ffaefd07409bbc54d22dc25ce76..2f9bc46b8fd4266d7ac79203254e8ddde12004f2 100644 (file)
@@ -2,14 +2,14 @@
  SecFixupTask class.\r
 \r
  SecFixupTask is used to call SecFixup.exe to fix up sec image.\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,57 +24,52 @@ 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
  * SecFixupTask class.\r
- * \r
+ *\r
  * SecFixupTask is used to call SecFixup.exe to fix up sec image.\r
  */\r
 public class SecFixupTask extends Task implements EfiDefine {\r
-    // /\r
-    // tool name\r
-    // /\r
+    //\r
+    // tool name\r
+    //\r
     private String toolName = "SecFixup";\r
 \r
-    // /\r
-    // input file\r
-    // /\r
-    private String secExeFile = "";\r
+    //\r
+    // input file\r
+    //\r
+    private FileArg secExeFile = new FileArg();\r
 \r
-    // /\r
-    // output file\r
-    // /\r
-    private String resetVectorDataFile = "";\r
+    //\r
+    // output file\r
+    //\r
+    private FileArg resetVectorDataFile = new FileArg();\r
 \r
-    // /\r
-    // / output directory, this variable is added by jave wrap\r
-    // /\r
-    private String outputFile = "";\r
+    //\r
+    // output file\r
+    //\r
+    private FileArg outputFile = new FileArg();\r
 \r
-    // /\r
-    // / output directory\r
-    // /\r
-    private String outputDir = "";\r
+    //\r
+    // output directory, this variable is added by jave wrap\r
+    //\r
+    private String outputDir = ".";\r
 \r
     /**\r
-     * execute\r
-     * \r
-     * SecFixupTask execute function is to assemble tool command line & execute\r
-     * tool command line\r
-     * \r
-     * @throws BuidException\r
-     */\r
+      execute\r
+     \r
+      SecFixupTask execute function is to assemble tool command line & execute\r
+      tool command line\r
+     \r
+      @throws BuidException\r
+     **/\r
     public void execute() throws BuildException {\r
 \r
         Project project = this.getOwningTarget().getProject();\r
-        //\r
-        // set Logger\r
-        //\r
-        FrameworkLogger logger = new FrameworkLogger(project, toolName\r
-                .toLowerCase());\r
-        EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
-        EdkLog.setLogger(logger);\r
+\r
         //\r
         // absolute path of efi tools\r
         //\r
@@ -89,13 +84,7 @@ public class SecFixupTask extends Task implements EfiDefine {
         //\r
         // argument of tools\r
         //\r
-        if (!this.outputDir.equalsIgnoreCase("")) {\r
-            argument = this.secExeFile + " " + this.resetVectorDataFile + " "\r
-                    + this.outputDir + File.separatorChar + this.outputFile;\r
-        } else {\r
-            argument = this.secExeFile + " " + this.resetVectorDataFile + " "\r
-                    + this.outputFile;\r
-        }\r
+        argument = "" + secExeFile + resetVectorDataFile + outputFile;\r
 \r
         //\r
         // return value of fwimage execution\r
@@ -113,11 +102,14 @@ public class SecFixupTask extends Task implements EfiDefine {
 \r
             runner.setAntRun(project);\r
             runner.setCommandline(cmdline.getCommandline());\r
+            runner.setWorkingDirectory(new File(outputDir));\r
+\r
             //\r
             // Set debug log information.\r
             //\r
-            EdkLog.log(EdkLog.EDK_INFO, Commandline.toString(cmdline\r
-                    .getCommandline()));\r
+            EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
+            EdkLog.log(this, EdkLog.EDK_INFO, secExeFile.toFileList() \r
+                + resetVectorDataFile.toFileList() + " => " + outputFile.toFileList());\r
 \r
             revl = runner.execute();\r
 \r
@@ -125,16 +117,13 @@ public class SecFixupTask extends Task implements EfiDefine {
                 //\r
                 // command execution success\r
                 //\r
-                EdkLog.log(EdkLog.EDK_INFO, "SecFixup succeeded!");\r
+                EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");\r
             } else {\r
                 //\r
                 // command execution fail\r
                 //\r
-                EdkLog.log(EdkLog.EDK_ERROR, "SecFixup failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-                throw new BuildException("SecFixup failed. (error="\r
-                        + Integer.toHexString(revl) + ")");\r
-\r
+                EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = "+ Integer.toHexString(revl));\r
+                throw new BuildException(toolName + " failed!");\r
             }\r
         } catch (Exception e) {\r
             throw new BuildException(e.getMessage());\r
@@ -142,93 +131,93 @@ public class SecFixupTask extends Task implements EfiDefine {
     }\r
 \r
     /**\r
-     * getSecExeFile\r
-     * \r
-     * This function is to get class member "secExeFile".\r
-     * \r
-     * @return string of sectExe file name.\r
-     */\r
+      getSecExeFile\r
+     \r
+      This function is to get class member "secExeFile".\r
+     \r
+      @return string of sectExe file name.\r
+     **/\r
     public String getSecExeFile() {\r
-        return this.secExeFile;\r
+        return this.secExeFile.getValue();\r
     }\r
 \r
     /**\r
-     * setSecExeFile\r
-     * \r
-     * This function is to set class member "secExeFile".\r
-     * \r
-     * @param secExeFile\r
-     *            string of secExe file name.\r
-     */\r
+      setSecExeFile\r
+     \r
+      This function is to set class member "secExeFile".\r
+     \r
+      @param secExeFile\r
+                 string of secExe file name.\r
+     **/\r
     public void setSecExeFile(String secExeFile) {\r
-        this.secExeFile = secExeFile;\r
+        this.secExeFile.setArg(" ", secExeFile);\r
     }\r
 \r
     /**\r
-     * getResetVectorDataFile\r
-     * \r
-     * This function is to get class member "resetVectorDataFile"\r
-     * \r
-     * @return resetVectorDataFile string of resetVectorData file name.\r
-     */\r
+      getResetVectorDataFile\r
+     \r
+      This function is to get class member "resetVectorDataFile"\r
+     \r
+      @return resetVectorDataFile string of resetVectorData file name.\r
+     **/\r
     public String getResetVectorDataFile() {\r
-        return this.resetVectorDataFile;\r
+        return this.resetVectorDataFile.getValue();\r
     }\r
 \r
     /**\r
-     * setResetVectorDataFile\r
-     * \r
-     * This function is to set class member "resetVectorDataFile"\r
-     * \r
-     * @param resetVectorDataFile\r
-     *            string of resetVectorData file name.\r
-     */\r
+      setResetVectorDataFile\r
+     \r
+      This function is to set class member "resetVectorDataFile"\r
+     \r
+      @param resetVectorDataFile\r
+                 string of resetVectorData file name.\r
+     **/\r
     public void setResetVectorDataFile(String resetVectorDataFile) {\r
-        this.resetVectorDataFile = resetVectorDataFile;\r
+        this.resetVectorDataFile.setArg(" ", resetVectorDataFile);\r
     }\r
 \r
     /**\r
-     * getOutputFile\r
-     * \r
-     * This function is to get class member "outputFile"\r
-     * \r
-     * @return outputFile string of output file name.\r
-     */\r
+      getOutputFile\r
+     \r
+      This function is to get class member "outputFile"\r
+     \r
+      @return outputFile string of output file name.\r
+     **/\r
     public String getOutputFile() {\r
-        return outputFile;\r
+        return this.outputFile.getValue();\r
     }\r
 \r
     /**\r
-     * setOutputFile\r
-     * \r
-     * This function is to set class member "outputFile"\r
-     * \r
-     * @param outputFile\r
-     *            string of output file name.\r
-     */\r
+      setOutputFile\r
+     \r
+      This function is to set class member "outputFile"\r
+     \r
+      @param outputFile\r
+                 string of output file name.\r
+     **/\r
     public void setOutputFile(String outputFile) {\r
-        this.outputFile = outputFile;\r
+        this.outputFile.setArg(" ", outputFile);\r
     }\r
 \r
     /**\r
-     * getOutputDir\r
-     * \r
-     * This function is to get class member "outputDir"\r
-     * \r
-     * @return outputDir name of output directory\r
-     */\r
+      getOutputDir\r
+     \r
+      This function is to get class member "outputDir"\r
+     \r
+      @return outputDir name of output directory\r
+     **/\r
     public String getOutputDir() {\r
         return outputDir;\r
     }\r
 \r
     /**\r
-     * setOutputDir\r
-     * \r
-     * This function is to set class member "outputDir"\r
-     * \r
-     * @param outputDir\r
-     *            name of output directory\r
-     */\r
+      setOutputDir\r
+     \r
+      This function is to set class member "outputDir"\r
+     \r
+      @param outputDir\r
+                 name of output directory\r
+     **/\r
     public void setOutputDir(String outputDir) {\r
         this.outputDir = outputDir;\r
     }\r