]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java
Refine the code for PCD tools.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / pcd / action / PlatformPcdPreprocessActionForBuilding.java
index a0a40eb4d1b83673b6b4bb528b194bf2ba7e3cdd..4d2335dfd2525975e791e01d124b1bce262b858e 100644 (file)
@@ -19,7 +19,6 @@ package org.tianocore.build.pcd.action;
 \r
 import java.io.File;\r
 import java.io.IOException;\r
-import java.math.BigInteger;\r
 import java.util.ArrayList;\r
 import java.util.Iterator;\r
 import java.util.List;\r
@@ -50,7 +49,7 @@ import org.tianocore.pcd.exception.PlatformPcdPreprocessException;
 **/\r
 public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreprocessAction {\r
     ///\r
-    /// FPD file is the root file.\r
+    /// FPD file path.\r
     ///\r
     private String                      fpdFilePath;\r
 \r
@@ -88,7 +87,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
     /**\r
       Common function interface for outer.\r
 \r
-      @param fpdFilePath    The fpd file path of current build or analysis.\r
+      @param fpdFilePath    The fpd file path of current build or processing.\r
       @param messageLevel   The message level for this Action.\r
 \r
       @throws  PlatformPreprocessBuildException \r
@@ -98,7 +97,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
     **/\r
     public void perform(String fpdFilePath, int messageLevel) \r
         throws PlatformPcdPreprocessBuildException {\r
-        setFPDFilePath(fpdFilePath);\r
+        this.fpdFilePath = fpdFilePath;\r
         setActionMessageLevel(messageLevel);\r
         checkParameter();\r
         execute();\r
@@ -152,7 +151,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
         try {\r
             genPcdDatabaseSourceCode ();\r
         } catch (EntityException exp) {\r
-            throw new PlatformPcdPreprocessBuildException(errorMessageHeader + exp.getMessage());\r
+            throw new PlatformPcdPreprocessBuildException(errorMessageHeader + "\r\n" + exp.getMessage());\r
         }\r
     }\r
 \r
@@ -323,7 +322,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
 \r
             dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),\r
                                                           tokenSpaceStrRet);\r
-            if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {\r
+            if (dynamicPrimaryKey.equals(token.getPrimaryKeyString())) {\r
                 return dynamicPcdBuildDataArray.get(index);\r
             }\r
         }\r
@@ -374,11 +373,11 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
         File file = null;\r
 \r
         if (fpdFilePath == null) {\r
-            throw new PlatformPcdPreprocessBuildException("WorkspacePath and FPDFileName should be empty for CollectPCDAtion!");\r
+            throw new PlatformPcdPreprocessBuildException("FPDFileName should be empty for CollectPCDAtion!");\r
         }\r
 \r
         if (fpdFilePath.length() == 0) {\r
-            throw new PlatformPcdPreprocessBuildException("WorkspacePath and FPDFileName should be empty for CollectPCDAtion!");\r
+            throw new PlatformPcdPreprocessBuildException("FPDFileName should be empty for CollectPCDAtion!");\r
         }\r
 \r
         file = new File(fpdFilePath);\r
@@ -387,23 +386,4 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
             throw new PlatformPcdPreprocessBuildException("FPD File " + fpdFilePath + " does not exist!");\r
         }\r
     }\r
-\r
-    /**\r
-      Test case function\r
-\r
-      @param argv  parameter from command line\r
-    **/\r
-    public static void main(String argv[]) throws PlatformPcdPreprocessBuildException {\r
-        PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();\r
-        String projectDir = "x:/edk2";\r
-        ca.setFPDFilePath(projectDir + "/EdkNt32Pkg/Nt32.fpd");\r
-        ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL);\r
-        GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",\r
-                            projectDir,\r
-                            "tools_def.txt");\r
-        System.out.println("After initInfo!");\r
-        FpdParserTask fpt = new FpdParserTask();\r
-        fpt.parseFpdFile(new File(projectDir + "/EdkNt32Pkg/Nt32.fpd"));\r
-        ca.execute();\r
-    }\r
 }\r