]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1.add code to support friendly output message.
authorjjin9 <jjin9@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 24 Oct 2006 01:02:59 +0000 (01:02 +0000)
committerjjin9 <jjin9@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 24 Oct 2006 01:02:59 +0000 (01:02 +0000)
2.fix the bug, and support "ContextTool /?"

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1831 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/ContextTool/org/tianocore/context/ContextMain.java
Tools/Java/Source/ContextTool/org/tianocore/context/HelpInfo.java
Tools/Java/Source/ContextTool/org/tianocore/context/ParseParameter.java
Tools/Java/Source/ContextTool/org/tianocore/context/TargetFile.java
Tools/bin/ContextTool.bat

index 7ee7d6c7c962efbc901fb3b3c29ec1031685717f..e96bb07fe058e18bd10a7411f53f4e1d7533dc71 100644 (file)
@@ -17,7 +17,8 @@ public class ContextMain {
     public static void main(String[] args) {\r
 \r
         if (TargetFile.validateFilename("target.txt") == false) {\r
     public static void main(String[] args) {\r
 \r
         if (TargetFile.validateFilename("target.txt") == false) {\r
-            System.out.printf("%n%s", "Target.txt can't be found in WorkSpace. Please check it!");\r
+            String workspacePath = System.getenv("WORKSPACE");\r
+            System.out.printf("%n%s%n", "target.txt can't be found. Please check it in " + workspacePath + "\\Tool\\Conf");\r
             System.exit(0);\r
         }\r
         \r
             System.exit(0);\r
         }\r
         \r
@@ -41,6 +42,7 @@ public class ContextMain {
             System.exit(0);\r
         }\r
         \r
             System.exit(0);\r
         }\r
         \r
-        System.out.printf("%n%s", "Target.txt generate successfully!");\r
+        String workspacePath = System.getenv("WORKSPACE");\r
+        System.out.printf("%n%s%n", workspacePath + "\\Tool\\Conf\\target.txt is generated successfully!");\r
     }\r
 }\r
     }\r
 }\r
index ca9b099883cbb66a833468d724fbb47b4258a6ac..af2b6530161ba16ba2ecc6f614634804f541596e 100644 (file)
@@ -33,6 +33,10 @@ public class HelpInfo {
         }\r
         \r
         System.out.printf("\n%s", ExampleString);\r
         }\r
         \r
         System.out.printf("\n%s", ExampleString);\r
+        System.out.printf("\n%s", str1);\r
+        System.out.printf("\n%s", str2);\r
+        System.out.printf("\n%s", str3);\r
+        System.out.printf("\n%s", str4);\r
     }\r
 \r
     /** \r
     }\r
 \r
     /** \r
@@ -96,6 +100,14 @@ public class HelpInfo {
     \r
     private static final String ExampleString = "Example: ContextTool -a IA32 IA64 EBC -c Tools/Conf/tools_def.txt -t DEBUG -n GCC -p EdkNt32Pkg/Nt32.fpd -m 2\n";\r
 \r
     \r
     private static final String ExampleString = "Example: ContextTool -a IA32 IA64 EBC -c Tools/Conf/tools_def.txt -t DEBUG -n GCC -p EdkNt32Pkg/Nt32.fpd -m 2\n";\r
 \r
+    private static final String str1 = "show current sub setting: ContextTool -x";\r
+    \r
+    private static final String str2 = "show possible sub setting: ContextTool -x ?";\r
+    \r
+    private static final String str3 = "clean current sub setting: ContextTool -x 0";\r
+    \r
+    private static final String str4 = "x is the sub setting option, such as p, a, n, m, t, c.\n";\r
+    \r
     private static final String HString = "-h";\r
 \r
     private static final String HStringInfo = "print usage info";\r
     private static final String HString = "-h";\r
 \r
     private static final String HStringInfo = "print usage info";\r
index 6b210ec1af265a27fef5c4dd8fc2e60ba1b0b493..d58d28b01087103bf5961c638df294766dd91aef 100644 (file)
@@ -35,7 +35,7 @@ public class ParseParameter {
                 return false;\r
             }\r
             if( args[0].charAt(0) != '-' ){\r
                 return false;\r
             }\r
             if( args[0].charAt(0) != '-' ){\r
-                System.out.printf("%s\n", "Error arguments! Please type \"ContextTool -h\" for helpinfo.");\r
+                System.out.printf("%s\n", "Error Parameters! Please type \"ContextTool -h\" for helpinfo.");\r
                 return false;\r
             }\r
             for(int i=0; i<args.length; i++){\r
                 return false;\r
             }\r
             for(int i=0; i<args.length; i++){\r
@@ -43,7 +43,7 @@ public class ParseParameter {
                     ((args[i].compareTo("-a") != 0) && (args[i].compareTo("-c") != 0) && \r
                     (args[i].compareTo("-n") != 0) && (args[i].compareTo("-p") != 0) && \r
                     (args[i].compareTo("-t") != 0) && (args[i].compareTo("-m") != 0)))){\r
                     ((args[i].compareTo("-a") != 0) && (args[i].compareTo("-c") != 0) && \r
                     (args[i].compareTo("-n") != 0) && (args[i].compareTo("-p") != 0) && \r
                     (args[i].compareTo("-t") != 0) && (args[i].compareTo("-m") != 0)))){\r
-                    System.out.printf("%s\n", "Error arguments! Please type \"ContextTool -h\" for helpinfo.");                                                                                                                                                            \r
+                    System.out.printf("%s\n", "Error Parameters! Please type \"ContextTool -h\" for helpinfo.");                                                                                                                                                            \r
                     return false;\r
                 }\r
             }\r
                     return false;\r
                 }\r
             }\r
@@ -86,7 +86,8 @@ public class ParseParameter {
                 //argstr is "-p ? ", display possible setting\r
                 //\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
                 //argstr is "-p ? ", display possible setting\r
                 //\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
-                    System.out.printf( "%s\n", "assign the platform FPD file's relative path to WORKSPACE" );\r
+                    String workspacePath = System.getenv("WORKSPACE");\r
+                    System.out.printf( "%s\n", "Assign a platform FPD file with relative path to " + workspacePath);\r
                     return 2;\r
                 }\r
                 //\r
                     return 2;\r
                 }\r
                 //\r
@@ -99,7 +100,7 @@ public class ParseParameter {
                 }\r
                 String[] S = argstr.split(" ");\r
                 if(S.length > 2){\r
                 }\r
                 String[] S = argstr.split(" ");\r
                 if(S.length > 2){\r
-                    System.out.printf( "%s\n", "The number of ACTIVE_PLATFORM can not more than 1.");\r
+                    System.out.printf( "%s\n", "There should be none or only one ACTIVE_PLATFORM. Please check the number of value which follow \"-p\".");\r
                     return 3;\r
                 }\r
                 curpstr = pstr.concat(argstr.substring(2));\r
                     return 3;\r
                 }\r
                 curpstr = pstr.concat(argstr.substring(2));\r
@@ -110,7 +111,7 @@ public class ParseParameter {
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
-                    System.out.printf( "%s\n", "What kind of the version is the binary target, such as DEBUG, RELEASE" );\r
+                    System.out.printf( "%s\n", "What kind of the version is the binary target, such as DEBUG, RELEASE." );\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
@@ -126,7 +127,7 @@ public class ParseParameter {
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
-                    System.out.printf( "%s\n", "What kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM" );\r
+                    System.out.printf( "%s\n", "What kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM." );\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
@@ -142,7 +143,8 @@ public class ParseParameter {
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
-                    System.out.printf( "%s\n", "Assign a txt file with the relative path to WORKSPACE, which specify the tools to use for the build and must be located in the path: WORKSPACE/Tools/Conf/" );\r
+                    String workspacePath = System.getenv("WORKSPACE");\r
+                    System.out.printf( "%s\n", "Assign a txt file with relative path to " + workspacePath + ", which specify the tools to use for the build and must be located in the path:" + workspacePath + "\\Tools\\Conf" );\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
@@ -152,7 +154,7 @@ public class ParseParameter {
                 }\r
                 String[] S = argstr.split(" ");\r
                 if(S.length > 2){\r
                 }\r
                 String[] S = argstr.split(" ");\r
                 if(S.length > 2){\r
-                    System.out.printf( "%s\n", "The number of TOOL_CHAIN_CONF can not more than 1.");\r
+                    System.out.printf( "%s\n", "There should be one and only one TOOL_CHAIN_CONF. Please check the number of value which follow \"-c\".");\r
                     return 3;\r
                 }\r
                 curcstr = cstr.concat(argstr.substring(2));\r
                     return 3;\r
                 }\r
                 curcstr = cstr.concat(argstr.substring(2));\r
@@ -163,7 +165,7 @@ public class ParseParameter {
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
                     return 1;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '?'){\r
-                    System.out.printf( "%s\n", "Specify the TagName, such as GCC, MSFT" );\r
+                    System.out.printf( "%s\n", "Specify the TagName, such as GCC, MSFT." );\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
                     return 2;\r
                 }\r
                 if(argstr.length() < 6 && argstr.charAt(3) == '0'){\r
@@ -184,7 +186,7 @@ public class ParseParameter {
                 }\r
                 String[] S = argstr.split(" ");\r
                 if(S.length > 2){\r
                 }\r
                 String[] S = argstr.split(" ");\r
                 if(S.length > 2){\r
-                    System.out.printf( "%s\n", "The format of number is wrong.");\r
+                    System.out.printf( "%s\n", "There should be one and only one integer, which doesn't include space.");\r
                     return 3;\r
                 }\r
                 mstr += argstr.substring(2);\r
                     return 3;\r
                 }\r
                 mstr += argstr.substring(2);\r
@@ -259,8 +261,7 @@ public class ParseParameter {
         \r
         return true;\r
     }\r
         \r
         return true;\r
     }\r
-     \r
-    public static int length  = 0;\r
+    \r
     public static String pstr = new String("ACTIVE_PLATFORM                     = ");\r
     public static String tstr = new String("TARGET                              = ");\r
     public static String astr = new String("TARGET_ARCH                         = ");\r
     public static String pstr = new String("ACTIVE_PLATFORM                     = ");\r
     public static String tstr = new String("TARGET                              = ");\r
     public static String astr = new String("TARGET_ARCH                         = ");\r
@@ -277,14 +278,6 @@ public class ParseParameter {
     public static String curmstr = null;\r
     public static String curmestr = null;\r
     \r
     public static String curmstr = null;\r
     public static String curmestr = null;\r
     \r
-    public static int plength = 0;\r
-    public static int tlength = 0;\r
-    public static int alength = 0;\r
-    public static int clength = 0;\r
-    public static int nlength = 0;\r
-    public static int mlength = 0;\r
-    public static int melength = 0;\r
-    \r
     public static boolean npflag = false;\r
     public static boolean ntflag = false;\r
     public static boolean naflag = false;\r
     public static boolean npflag = false;\r
     public static boolean ntflag = false;\r
     public static boolean naflag = false;\r
index 06a031c8bb736fd01a8c831a68d9b30ba15aee61..122adf03ce6646c0112ffa458db3519b672fd0ba 100644 (file)
@@ -16,46 +16,13 @@ import java.io.BufferedReader;
 import java.io.BufferedWriter;\r
 import java.io.File;\r
 import java.io.FileNotFoundException;\r
 import java.io.BufferedWriter;\r
 import java.io.File;\r
 import java.io.FileNotFoundException;\r
-import java.io.FileOutputStream;\r
 import java.io.FileReader;\r
 import java.io.FileWriter;\r
 import java.io.IOException;\r
 import java.io.FileReader;\r
 import java.io.FileWriter;\r
 import java.io.IOException;\r
-import java.nio.ByteBuffer;\r
-import java.nio.channels.FileChannel;\r
 \r
 public class TargetFile {\r
 \r
 \r
 public class TargetFile {\r
 \r
-    /** \r
-     * check the validity of path and file\r
-     * @param String filename : the name of target file\r
-     * @return true or false\r
-     **/\r
-    public static boolean setFile(String filename) {\r
-\r
-        String workspacePath = System.getenv("WORKSPACE");\r
-        \r
-        Fd = new File(workspacePath + File.separator + "Tools" + File.separator + "Conf" + File.separator + filename);\r
-\r
-        if (Fd.exists() == true) {\r
-            if (createTempFile(filename + "tmp") == false) {\r
-                return false;\r
-            }\r
-            if (readwriteFile() == false) {\r
-                return false;\r
-            }\r
-            return true;\r
-        } else {\r
-            try {\r
-                Fd.createNewFile();\r
-            } catch (IOException e) {\r
-                System.out.printf("%n%s", "Create the file:target.txt failed!");\r
-                return false;\r
-            }\r
-        }\r
-        TargetFile.writeFile(Fd);\r
-        return true;\r
-    }\r
-    \r
+   \r
     \r
     /** \r
      * validate the filename\r
     \r
     /** \r
      * validate the filename\r
@@ -89,15 +56,14 @@ public class TargetFile {
 \r
         if (TempFd.exists() == true) {\r
             if (TempFd.delete() == false) {\r
 \r
         if (TempFd.exists() == true) {\r
             if (TempFd.delete() == false) {\r
-                System.out.println("\n#  delete file failed !");\r
+                System.out.printf("%n%s%n", "target.txttmp has been existed, and failed in deletion!");\r
                 return false;\r
             }\r
         }\r
         try {\r
             TempFd.createNewFile();\r
         } catch (IOException e) {\r
                 return false;\r
             }\r
         }\r
         try {\r
             TempFd.createNewFile();\r
         } catch (IOException e) {\r
-            System.out.printf("%n%s",\r
-                    "Create the temp file:target.txttmp failed!");\r
+            System.out.printf("%n%s%n", "Failed in creation of the temp file:target.txttmp!");\r
             return false;\r
         }\r
 \r
             return false;\r
         }\r
 \r
@@ -122,13 +88,13 @@ public class TargetFile {
             br = new BufferedReader(new FileReader(Fd));\r
         } catch (FileNotFoundException e) {\r
             System.out\r
             br = new BufferedReader(new FileReader(Fd));\r
         } catch (FileNotFoundException e) {\r
             System.out\r
-                    .println("\n# create the BufferedReader failed, because can't find the file:target.txt!");\r
+                    .println("\n# Creating BufferedReader fail!");\r
             return false;\r
         }\r
         try {\r
             bw = new BufferedWriter(new FileWriter(TempFd));\r
         } catch (IOException e) {\r
             return false;\r
         }\r
         try {\r
             bw = new BufferedWriter(new FileWriter(TempFd));\r
         } catch (IOException e) {\r
-            System.out.println("\n# create the BufferedWriter failed!");\r
+            System.out.println("\n# Creating the BufferedWriter fail!");\r
             return false;\r
         }\r
         \r
             return false;\r
         }\r
         \r
@@ -323,7 +289,7 @@ public class TargetFile {
                 bw.newLine();\r
             }\r
         } catch (IOException e) {\r
                 bw.newLine();\r
             }\r
         } catch (IOException e) {\r
-            System.out.println("\n#  read or write file error!");\r
+            System.out.println("\n# Reading or Writing file fail!");\r
             return false;\r
         }\r
 \r
             return false;\r
         }\r
 \r
@@ -332,16 +298,16 @@ public class TargetFile {
             bw.close();\r
         } catch (IOException e) {\r
             System.out\r
             bw.close();\r
         } catch (IOException e) {\r
             System.out\r
-                    .println("\n#  close BufferedReader&BufferedWriter error");\r
+                    .println("\n# Closing BufferedReader&BufferedWriter fail!");\r
             return false;\r
         }\r
 \r
         if (Fd.delete() == false) {\r
             return false;\r
         }\r
 \r
         if (Fd.delete() == false) {\r
-            System.out.println("\n#  delete file failed !");\r
+            System.out.println("\n# Deleting file fail!");\r
             return false;\r
         }\r
         if (TempFd.renameTo(Fd) == false) {\r
             return false;\r
         }\r
         if (TempFd.renameTo(Fd) == false) {\r
-            System.out.println("\n#  rename file failed !");\r
+            System.out.println("\n#  Renaming file failed!");\r
             return false;\r
         }\r
 \r
             return false;\r
         }\r
 \r
@@ -362,7 +328,7 @@ public class TargetFile {
             br = new BufferedReader(new FileReader(Fd));\r
         } catch (FileNotFoundException e) {\r
             System.out\r
             br = new BufferedReader(new FileReader(Fd));\r
         } catch (FileNotFoundException e) {\r
             System.out\r
-                    .println("\n# create the BufferedReader failed, because can't find the file:target.txt!");\r
+                    .println("\n# Creating BufferedReader fail!");\r
             return false;\r
         }\r
         try {\r
             return false;\r
         }\r
         try {\r
@@ -381,30 +347,23 @@ public class TargetFile {
                 } else {\r
                     if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {\r
                         ParseParameter.curpstr = textLine;\r
                 } else {\r
                     if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {\r
                         ParseParameter.curpstr = textLine;\r
-                        ParseParameter.plength = textLine.indexOf('=');\r
                     } else if (textLine.indexOf("TARGET_ARCH") != -1) {\r
                         ParseParameter.curastr = textLine;\r
                     } else if (textLine.indexOf("TARGET_ARCH") != -1) {\r
                         ParseParameter.curastr = textLine;\r
-                        ParseParameter.alength = textLine.indexOf('=');\r
                     } else if (textLine.indexOf("TARGET") != -1) {\r
                         ParseParameter.curtstr = textLine;\r
                     } else if (textLine.indexOf("TARGET") != -1) {\r
                         ParseParameter.curtstr = textLine;\r
-                        ParseParameter.tlength = textLine.indexOf('=');\r
                     } else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {\r
                         ParseParameter.curcstr = textLine;\r
                     } else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {\r
                         ParseParameter.curcstr = textLine;\r
-                        ParseParameter.clength = textLine.indexOf('=');\r
                     } else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {\r
                         ParseParameter.curnstr = textLine;\r
                     } else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {\r
                         ParseParameter.curnstr = textLine;\r
-                        ParseParameter.nlength = textLine.indexOf('=');\r
                     } else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {\r
                         ParseParameter.curmstr = textLine;\r
                     } else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {\r
                         ParseParameter.curmstr = textLine;\r
-                        ParseParameter.mlength = textLine.indexOf('=');\r
                     } else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {\r
                         ParseParameter.curmestr = textLine;\r
                     } else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {\r
                         ParseParameter.curmestr = textLine;\r
-                        ParseParameter.melength = textLine.indexOf('=');\r
                     }\r
                 }\r
             }\r
         } catch (IOException e) {\r
                     }\r
                 }\r
             }\r
         } catch (IOException e) {\r
-            System.out.println("\n#  read file error!");\r
+            System.out.println("\n# Reading file fail!");\r
             return false;\r
         }\r
 \r
             return false;\r
         }\r
 \r
@@ -412,102 +371,13 @@ public class TargetFile {
             br.close();\r
         } catch (IOException e) {\r
             System.out\r
             br.close();\r
         } catch (IOException e) {\r
             System.out\r
-                    .println("\n#  close BufferedReader error");\r
+                    .println("\n# Closing BufferedReader fail!");\r
             return false;\r
         }\r
         return true;\r
     }\r
     \r
 \r
             return false;\r
         }\r
         return true;\r
     }\r
     \r
 \r
-    /**\r
-     * according to user's input args, write the file directly\r
-     * @param File fd : the File of the target file\r
-     * @return true or false\r
-     **/\r
-    private static boolean writeFile(File fd) {\r
-\r
-        if (fd.canWrite() != true)\r
-            return false;\r
-\r
-        FileOutputStream outputFile = null;\r
-        try {\r
-            outputFile = new FileOutputStream(fd);\r
-        } catch (FileNotFoundException e) {\r
-            System.out\r
-                    .println("\n#  can't find the file when open the output stream !");\r
-            return false;\r
-        }\r
-        FileChannel outputChannel = outputFile.getChannel();\r
-\r
-        ByteBuffer[] buffers = new ByteBuffer[7];\r
-        buffers[0] = ByteBuffer.allocate(ParseParameter.pstr.toString().length());\r
-        buffers[1] = ByteBuffer.allocate(ParseParameter.tstr.toString().length());\r
-        buffers[2] = ByteBuffer.allocate(ParseParameter.astr.toString().length());\r
-        buffers[3] = ByteBuffer.allocate(ParseParameter.cstr.toString().length());\r
-        buffers[4] = ByteBuffer.allocate(ParseParameter.nstr.toString().length());\r
-        buffers[5] = ByteBuffer.allocate(ParseParameter.mestr.toString().length());\r
-        buffers[6] = ByteBuffer.allocate(ParseParameter.mstr.toString().length());\r
-\r
-        buffers[0].put(ParseParameter.pstr.toString().getBytes()).flip();\r
-        buffers[1].put(ParseParameter.tstr.toString().getBytes()).flip();\r
-        buffers[2].put(ParseParameter.astr.toString().getBytes()).flip();\r
-        buffers[3].put(ParseParameter.cstr.toString().getBytes()).flip();\r
-        buffers[4].put(ParseParameter.nstr.toString().getBytes()).flip();\r
-        buffers[5].put(ParseParameter.mestr.toString().getBytes()).flip();\r
-        buffers[6].put(ParseParameter.mstr.toString().getBytes()).flip();\r
-\r
-        try {\r
-            ByteBuffer bufofCP = ByteBuffer.allocate(Copyright.length());\r
-            bufofCP.put(Copyright.getBytes()).flip();\r
-            outputChannel.write(bufofCP);\r
-            \r
-            ByteBuffer bufofFI = ByteBuffer.allocate(Fileinfo.length());\r
-            bufofFI.put(Fileinfo.getBytes()).flip();\r
-            outputChannel.write(bufofFI);\r
-            \r
-            ByteBuffer buffer0 = ByteBuffer.allocate(pusage.length());\r
-            buffer0.put(pusage.getBytes()).flip();\r
-            outputChannel.write(buffer0);\r
-            outputChannel.write(buffers[0]);\r
-            \r
-            ByteBuffer buffer1 = ByteBuffer.allocate(tusage.length());\r
-            buffer1.put(tusage.getBytes()).flip();\r
-            outputChannel.write(buffer1);\r
-            outputChannel.write(buffers[1]);\r
-            \r
-            ByteBuffer buffer2 = ByteBuffer.allocate(ausage.length());\r
-            buffer2.put(ausage.getBytes()).flip();\r
-            outputChannel.write(buffer2);\r
-            outputChannel.write(buffers[2]);\r
-            \r
-            ByteBuffer buffer3 = ByteBuffer.allocate(cusage.length());\r
-            buffer3.put(cusage.getBytes()).flip();\r
-            outputChannel.write(buffer3);\r
-            outputChannel.write(buffers[3]);\r
-            \r
-            ByteBuffer buffer4 = ByteBuffer.allocate(nusage.length());\r
-            buffer4.put(nusage.getBytes()).flip();\r
-            outputChannel.write(buffer4);\r
-            outputChannel.write(buffers[4]);\r
-            \r
-            ByteBuffer buffer5 = ByteBuffer.allocate(meusage.length());\r
-            buffer4.put(meusage.getBytes()).flip();\r
-            outputChannel.write(buffer5);\r
-            outputChannel.write(buffers[5]);\r
-            \r
-            ByteBuffer buffer6 = ByteBuffer.allocate(musage.length());\r
-            buffer4.put(musage.getBytes()).flip();\r
-            outputChannel.write(buffer6);\r
-            outputChannel.write(buffers[6]);\r
-            \r
-            outputFile.close();\r
-        } catch (IOException e) {\r
-            System.out.println("\n# The operations of file failed !");\r
-            return false;\r
-        }\r
-        return true;\r
-    }\r
-\r
     ///\r
     /// point to target.txttmp, a temp file, which is created and deleted during the tool's runtime.\r
     ///\r
     ///\r
     /// point to target.txttmp, a temp file, which is created and deleted during the tool's runtime.\r
     ///\r
@@ -529,74 +399,5 @@ public class TargetFile {
     private static boolean mflag = true;\r
     private static boolean meflag = true;\r
 \r
     private static boolean mflag = true;\r
     private static boolean meflag = true;\r
 \r
-    private static final String Copyright = "#\n"\r
-            + "#  Copyright (c) 2006, Intel Corporation\n"\r
-            + "#\n"\r
-            + "#  All rights reserved. This program and the accompanying materials\n"\r
-            + "#  are licensed and made available under the terms and conditions of the BSD License\n"\r
-            + "#  which accompanies this distribution.  The full text of the license may be found at\n"\r
-            + "#  http://opensource.org/licenses/bsd-license.php\n"\r
-            + "\n"\r
-            + "#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS,\n"\r
-            + "#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\n";\r
 \r
 \r
-    private static final String Fileinfo = "#\n"\r
-            + "#  Filename: target.template\n"\r
-            + "#\n"\r
-            + "#  ALL Paths are Relative to WORKSPACE\n"\r
-            + "\n"\r
-            + "#  Separate multiple LIST entries with a SINGLE SPACE character, do not use comma characters.\n"\r
-            + "#  Un-set an option by either commenting out the line, or not setting a value.\n";\r
-\r
-    private static final String pusage = "#\n"\r
-            + "#  PROPERTY              Type       Use         Description\n"\r
-            + "#  ----------------      --------   --------    -----------------------------------------------------------\n"\r
-            + "#  ACTIVE_PLATFORM       Filename   Recommended Specify the WORKSPACE relative Path and Filename\n"\r
-            + "#                                               of the platform FPD file that will be used for the build\n"\r
-            + "#                                               This line is required if and only if the current working\n"\r
-            + "#                                               directory does not contain one or more FPD files.\n";\r
-\r
-    private static final String tusage = "\n\n"\r
-            + "#  TARGET                List       Optional    Zero or more of the following: DEBUG, RELEASE, \n"\r
-            + "#                                               UserDefined; separated by a space character.  \n"\r
-            + "#                                               If the line is missing or no value is specified, all\n"\r
-            + "#                                               valid targets specified in the FPD file will attempt \n"\r
-            + "#                                               to be built.  The following line will build all platform\n"\r
-            + "#                                               targets.\n";\r
-\r
-    private static final String ausage = "\n\n"\r
-            + "#  TARGET_ARCH           List       Optional    What kind of architecture is the binary being target for.\n"\r
-            + "#                                               One, or more, of the following, IA32, IA64, X64, EBC or ARM.\n"\r
-            + "#                                               Multiple values can be specified on a single line, using \n"\r
-            + "#                                               space charaters to separate the values.  These are used \n"\r
-            + "#                                               during the parsing of an FPD file, restricting the build\n"\r
-            + "#                                               output target(s.)\n"\r
-            + "#                                               The Build Target ARCH is determined by a logical AND of:\n"\r
-            + "#                                               FPD BuildOptions: <SupportedArchitectures> tag\n"\r
-            + "#                                               If not specified, then all valid architectures specified \n"\r
-            + "#                                               in the FPD file, for which tools are available, will be \n"\r
-            + "#                                               built.\n";\r
-\r
-    private static final String cusage = "\n\n"\r
-            + "#  TOOL_DEFINITION_FILE  Filename  Optional   Specify the name of the filename to use for specifying \n"\r
-            + "#                                             the tools to use for the build.  If not specified, \n"\r
-            + "#                                             tools_def.txt will be used for the build.  This file \n"\r
-            + "#                                             MUST be located in the WORKSPACE/Tools/Conf directory.\n";\r
-\r
-    private static final String nusage = "\n\n"\r
-            + "#  TAGNAME               List      Optional   Specify the name(s) of the tools_def.txt TagName to use.\n"\r
-            + "#                                             If not specified, all applicable TagName tools will be \n"\r
-            + "#                                             used for the build.  The list uses space character separation.\n";\r
-    \r
-    private static final String musage = "\n\n"\r
-            + "#  MULTIPLE_THREAD       FLAG      Optional   Flag to enable multi-thread build. If not specified, default\n"\r
-            + "#                                             is \"Disable\". If your computer is multi-core or multiple CPUs,\n" \r
-            + "#                                             enabling this feature will bring much benefit. For multi-thread\n" \r
-            + "#                                             built, the log will write to ${BUILD_DIR}/build.log.\n" \r
-            + "#                                             This feature is only for PLATFORM build, and clean, cleanall or\n"\r
-            + "#                                             stand-alone module build is still using the normal way.\n";\r
-    private static final String meusage = "\n\n"\r
-            + "# MAX_CONCURRENT_THREAD_NUMBER  NUMBER  Optional  The number of concurrent threads. Default is 2. Recommend to\n" \r
-            + "#                                                 set this value to one more than the number of your compurter\n"\r
-            + "#                                                 cores or CPUs.\n";\r
 }\r
 }\r
index cdd685e6e30d72169e22a976c13b5507c5064f23..407c2e76a140b5058f9f9c76226d60471b43e29d 100644 (file)
@@ -29,7 +29,7 @@ if not exist %WORKSPACE%\Tools\Jars\ContextTool.jar (
 )\r
 \r
 @REM Run Framework Wizard\r
 )\r
 \r
 @REM Run Framework Wizard\r
-call "java" -cp "%WORKSPACE%\Tools\Jars\ContextTool.jar" org.tianocore.context.ContextMain %*\r
+java -cp %WORKSPACE%\Tools\Jars\ContextTool.jar org.tianocore.context.ContextMain %*\r
 \r
 goto end\r
 \r
 \r
 goto end\r
 \r