]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
Fixed grammar in messages.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / pcd / action / PCDAutoGenAction.java
index 5a429e41175c00507b7fc6c6c7bbca223afafdf1..5c7b29aa17e197f84e072ce147fe9639cea76afe 100644 (file)
@@ -31,6 +31,7 @@ import org.tianocore.pcd.exception.BuildActionException;
 import org.tianocore.pcd.entity.UsageIdentification;\r
 import org.tianocore.pcd.action.BuildAction;\r
 import org.tianocore.pcd.action.ActionMessage;\r
+import org.tianocore.build.exception.PcdAutogenException;\r
 \r
 /** This class is to manage how to generate the PCD information into Autogen.c and\r
     Autogen.h.\r
@@ -142,7 +143,7 @@ public class PCDAutoGenAction extends BuildAction {
     }\r
 \r
     /**\r
-      check the parameter for action class.\r
+      Override function: check the parameter for action class.\r
 \r
       @throws BuildActionException Bad parameter.\r
     **/\r
@@ -162,12 +163,6 @@ public class PCDAutoGenAction extends BuildAction {
     public void performAction() {\r
         ActionMessage.debug(this,\r
                             "Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");\r
-        //\r
-        // Check the PCD memory database manager is valid.\r
-        //\r
-        if(GlobalData.getPCDMemoryDBManager() == null) {\r
-            throw new BuildActionException("Memory database has not been initlizated!");\r
-        }\r
 \r
         dbManager = GlobalData.getPCDMemoryDBManager();\r
 \r
@@ -176,7 +171,7 @@ public class PCDAutoGenAction extends BuildAction {
         }\r
 \r
         ActionMessage.debug(this,\r
-                            "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens");\r
+                            "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens.");\r
 \r
         generateAutogenForModule();\r
     }\r
@@ -200,7 +195,7 @@ public class PCDAutoGenAction extends BuildAction {
 \r
         usageInstanceArray = null;\r
         if (!isBuildUsedLibrary) {\r
-            usageInstanceArray  = dbManager.getUsageInstanceArrayByModuleName(usageId);\r
+            usageInstanceArray  = dbManager.getUsageInstanceArrayById(usageId);\r
             MemoryDatabaseManager.UsageInstanceContext = usageInstanceArray;\r
             MemoryDatabaseManager.CurrentModuleName    = moduleName;\r
         } else if ((pcdNameArrayInMsa != null) && (pcdNameArrayInMsa.length > 0)) {\r
@@ -210,7 +205,7 @@ public class PCDAutoGenAction extends BuildAction {
             // these library should be used to autogen.\r
             //\r
             if (usageContext == null) {\r
-                usageInstanceArray  = dbManager.getUsageInstanceArrayByModuleName(usageId);\r
+                usageInstanceArray  = dbManager.getUsageInstanceArrayById(usageId);\r
             } else {\r
                 usageInstanceArray = new ArrayList<UsageInstance>();\r
 \r
@@ -233,9 +228,9 @@ public class PCDAutoGenAction extends BuildAction {
                         // All library's PCD should instanted in module's <ModuleSA> who\r
                         // use this library instance. If not, give errors.\r
                         //\r
-                        throw new BuildActionException (String.format("[PCD Autogen Error] Module %s use library instance %s, the PCD %s " +\r
-                                                                      "is required by this library instance, but can not find " +\r
-                                                                      "it in the %s's <ModuleSA> in FPD file!",\r
+                        throw new BuildActionException (String.format("Module %s using library instance %s; the PCD %s " +\r
+                                                                      "is required by this library instance, but can not be found " +\r
+                                                                      "in the %s's <ModuleSA> in the FPD file!",\r
                                                                       MemoryDatabaseManager.CurrentModuleName,\r
                                                                       moduleName,\r
                                                                       pcdNameArrayInMsa[index],\r
@@ -336,9 +331,7 @@ public class PCDAutoGenAction extends BuildAction {
                             WorkSpace,null);\r
 \r
         try {\r
-            collectionAction.perform(WorkSpace,\r
-                                     logFilePath,\r
-                                     ActionMessage.MAX_MESSAGE_LEVEL);\r
+            collectionAction.perform(logFilePath, ActionMessage.MAX_MESSAGE_LEVEL);\r
         } catch(Exception e) {\r
             e.printStackTrace();\r
         }\r