]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / ModifyInfTask.java
index a65b4b82cfe65cc72228532e9bc76ba24c25317e..58920645090ea73814f3ba6e1ca97aa45ed7d32a 100644 (file)
@@ -33,49 +33,43 @@ import org.tianocore.common.logger.EdkLog;
   ModifyInfTask is used to call Modify.exe to generate inf file.\r
 **/\r
 public class ModifyInfTask extends Task implements EfiDefine {\r
-    ///\r
-    /// tool name\r
-    ///\r
+    //\r
+    // tool name\r
+    //\r
     private String toolName = "ModifyInf";\r
 \r
-    ///\r
-    /// input FV inf file\r
-    ///\r
-    private String inputFVInfFileName = "";\r
+    //\r
+    // input FV inf file\r
+    //\r
+    private FileArg inputFVInfFile = new FileArg();\r
 \r
-    ///\r
-    /// output FV inf file\r
-    ///\r
-    private String outputFVInfFileName = "";\r
+    //\r
+    // output FV inf file\r
+    //\r
+    private FileArg outputFVInfFile = new FileArg();\r
 \r
-    ///\r
-    /// pattern string\r
-    ///\r
-    private String patternStr = "";\r
+    //\r
+    // pattern string\r
+    //\r
+    private ToolArg patternStr = new ToolArg();\r
 \r
-       ///\r
-       ///  Output dir\r
-       ///\r
-       private String outputDir = "";\r
+       //\r
+       //  Output dir\r
+       //\r
+       private String outputDir = ".";\r
 \r
     /**\r
-     * execute\r
-     *\r
-     * ModifyInfTask execute function is to assemble tool command line & execute\r
-     * tool command line\r
-     *\r
-     * @throws BuidException\r
-     */\r
+      execute\r
+     \r
+      ModifyInfTask 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, "modifyinftask");\r
-        EdkLog.setLogLevel(project.getProperty("env.LOGLEVEL"));\r
-        EdkLog.setLogger(logger);\r
-        //\r
         // absolute path of efi tools\r
         //\r
         String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
@@ -89,18 +83,7 @@ public class ModifyInfTask extends Task implements EfiDefine {
         //\r
         // argument of tools\r
         //\r
-               File file = new File(outputFVInfFileName);\r
-        if (!file.isAbsolute() && (!this.outputDir.equalsIgnoreCase(""))) {\r
-                       argument = this.inputFVInfFileName +\r
-                                      this.outputDir +\r
-                                          File.separatorChar +\r
-                                          this.outputFVInfFileName +\r
-                                          this.patternStr;\r
-               } else {\r
-                       argument = this.inputFVInfFileName +\r
-                                      this.outputFVInfFileName +\r
-                                      this.patternStr;\r
-               }\r
+        argument = "" + this.inputFVInfFile + this.outputFVInfFile + this.patternStr;\r
         //\r
         // return value of fwimage execution\r
         //\r
@@ -117,24 +100,27 @@ public class ModifyInfTask 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_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
-            EdkLog.log(EdkLog.EDK_INFO, (new File(this.inputFVInfFileName)).getName());\r
-            revl = runner.execute();\r
+            EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));\r
+            EdkLog.log(this, EdkLog.EDK_INFO, this.inputFVInfFile.toFileList()\r
+                + " => " + this.inputFVInfFile.toFileList());\r
 \r
+            revl = runner.execute();\r
             if (EFI_SUCCESS == revl) {\r
                 //\r
                 // command execution success\r
                 //\r
-                EdkLog.log(EdkLog.EDK_VERBOSE, "ModifyInfTask succeeded!");\r
+                EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");\r
             } else {\r
                 //\r
                 // command execution fail\r
                 //\r
-                EdkLog.log(EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));\r
-                throw new BuildException("ModifyInfTask failed!");\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 +128,93 @@ public class ModifyInfTask extends Task implements EfiDefine {
     }\r
 \r
     /**\r
-     * getinputFVInfFileName\r
-     *\r
-     * This function is to get class member "inputFVInfFileName".\r
-     *\r
-     * @return string of input inf file name.\r
-     */\r
-    public String getinputFVInfFileName() {\r
-        return this.inputFVInfFileName;\r
+      getinputFVInfFile\r
+     \r
+      This function is to get class member "inputFVInfFile".\r
+     \r
+      @return string of input inf file name.\r
+     **/\r
+    public String getinputFVInfFile() {\r
+        return this.inputFVInfFile.getValue();\r
     }\r
 \r
     /**\r
-     * setinputFVInfFileName\r
-     *\r
-     * This function is to set class member "inputFVInfFileName".\r
-     *\r
-     * @param inputFile\r
-     *            string of input inf file name.\r
-     */\r
-    public void setinputFVInfFileName(String inputFVInfFileName) {\r
-        this.inputFVInfFileName = inputFVInfFileName + " ";\r
+      setinputFVInfFile\r
+     \r
+      This function is to set class member "inputFVInfFile".\r
+     \r
+      @param inputFile\r
+                 string of input inf file name.\r
+     **/\r
+    public void setinputFVInfFile(String inputFVInfFileName) {\r
+        this.inputFVInfFile.setArg(" ", inputFVInfFileName);\r
     }\r
 \r
     /**\r
-     * getoutputFVInfFileName\r
-     *\r
-     * This function is to get class member "outputFVInfFileName"\r
-     *\r
-     * @return outputFVInfFileName string of output inf file name.\r
-     */\r
-    public String getoutputFVInfFileName() {\r
-        return this.outputFVInfFileName;\r
+      getoutputFVInfFile\r
+     \r
+      This function is to get class member "outputFVInfFile"\r
+     \r
+      @return outputFVInfFile string of output inf file name.\r
+     **/\r
+    public String getoutputFVInfFile() {\r
+        return this.outputFVInfFile.getValue();\r
     }\r
 \r
     /**\r
-     * setoutputFVInfFileName\r
-     *\r
-     * This function is to set class member "outputFVInfFileName"\r
-     *\r
-     * @param outputFVInfFileName\r
-     *            string of output  inf file name.\r
-     */\r
-    public void setoutputFVInfFileName(String outputFVInfFileName) {\r
-        this.outputFVInfFileName = outputFVInfFileName  + " ";\r
+      setoutputFVInfFile\r
+     \r
+      This function is to set class member "outputFVInfFile"\r
+     \r
+      @param outputFVInfFile\r
+                 string of output  inf file name.\r
+     **/\r
+    public void setoutputFVInfFile(String outputFVInfFileName) {\r
+        this.outputFVInfFile.setArg(" ", outputFVInfFileName);\r
     }\r
 \r
     /**\r
-     * getpatternStr\r
-     *\r
-     * This function is to get class member "patternStr"\r
-     *\r
-     * @return patternStr string of pattern.\r
-     */\r
+      getpatternStr\r
+     \r
+      This function is to get class member "patternStr"\r
+     \r
+      @return patternStr string of pattern.\r
+     **/\r
     public String getpatternStr() {\r
-        return this.patternStr;\r
+        return this.patternStr.getValue();\r
     }\r
 \r
     /**\r
-     * setpatternStr\r
-     *\r
-     * This function is to set class member "patternStr"\r
-     *\r
-     * @param patternStr\r
-     *            string of patternStr.\r
-     */\r
+      setpatternStr\r
+     \r
+      This function is to set class member "patternStr"\r
+     \r
+      @param patternStr\r
+                 string of patternStr.\r
+     **/\r
     public void setpatternStr(String patternStr) {\r
-        this.patternStr = patternStr;\r
+        this.patternStr.setArg(" ", patternStr);\r
     }\r
 \r
        /**\r
-     * getoutputDir\r
-     *\r
-     * This function is to get class member "outputDir"\r
-     *\r
-     * @return outputDir string of output directory.\r
-     */\r
+      getoutputDir\r
+     \r
+      This function is to get class member "outputDir"\r
+     \r
+      @return outputDir string of output directory.\r
+     **/\r
     public String getoutputDir() {\r
         return this.outputDir;\r
     }\r
 \r
     /**\r
-     * setoutputDir\r
-     *\r
-     * This function is to set class member "outputDir"\r
-     *\r
-     * @param patternStr\r
-     *            string of output directory.\r
-     */\r
+      setoutputDir\r
+     \r
+      This function is to set class member "outputDir"\r
+     \r
+      @param patternStr\r
+                 string of output directory.\r
+     **/\r
     public void setoutputDir(String outputDir) {\r
         this.outputDir = outputDir;\r
     }\r