]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
a) Fixed the issue that the unnecessary build for not specified ARCH in single module...
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / GlobalData.java
index 75c637ffe1dea8f74edf1fb1dddf33c16e358674..18b766dc422967284e08ade8e70d6bce04334464 100644 (file)
@@ -16,12 +16,20 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 package org.tianocore.build.global;\r
 \r
+import java.io.File;\r
+import java.util.HashMap;\r
+import java.util.HashSet;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Set;\r
+import java.util.logging.Logger;\r
+\r
 import org.apache.tools.ant.BuildException;\r
 import org.apache.xmlbeans.XmlObject;\r
 import org.tianocore.DbPathAndFilename;\r
 import org.tianocore.FrameworkDatabaseDocument;\r
 import org.tianocore.ModuleSurfaceAreaDocument;\r
-import org.tianocore.PcdBuildDefinitionDocument;\r
 import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
 import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.id.ModuleIdentification;\r
@@ -37,15 +45,6 @@ import org.tianocore.build.toolchain.ToolChainMap;
 import org.tianocore.exception.EdkException;\r
 import org.tianocore.logger.EdkLog;\r
 \r
-import java.io.File;\r
-import java.util.HashMap;\r
-import java.util.HashSet;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\r
-import java.util.logging.Logger;\r
-\r
 /**\r
   GlobalData provide initializing, instoring, querying and update global data.\r
   It is a bridge to intercommunicate between multiple component, such as AutoGen,\r
@@ -133,8 +132,6 @@ public class GlobalData {
 \r
     private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();\r
 \r
-    \r
-\r
     /**\r
       Parse framework database (DB) and all SPD files listed in DB to initialize\r
       the environment for next build. This method will only be executed only once\r
@@ -145,7 +142,7 @@ public class GlobalData {
       @throws BuildException\r
             Framework Dababase or SPD or MSA file is not valid\r
     **/\r
-    public synchronized static void initInfo(String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename) throws BuildException {\r
+    public synchronized static void initInfo(String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename ) throws BuildException {\r
         //\r
         // ensure this method will be revoked only once\r
         //\r
@@ -153,8 +150,8 @@ public class GlobalData {
             return;\r
         }\r
         globalFlag = true;\r
-        \r
-        //\r
+\r
+               // \r
         // Backup workspace directory. It will be used by other method\r
         //\r
         GlobalData.workspaceDir = workspaceDir.replaceAll("(\\\\)", "/");\r
@@ -230,7 +227,6 @@ public class GlobalData {
                 }\r
             }\r
         } catch (Exception e) {\r
-            e.printStackTrace();\r
             throw new BuildException("Parse workspace Database [" + dbFile.getPath() + "] Error.\n" + e.getMessage());\r
         }\r
     }\r
@@ -319,7 +315,11 @@ public class GlobalData {
         }\r
         fpdModuleSA.put(fpdModuleId, result);\r
     }\r
-    \r
+\r
+    public synchronized static boolean hasFpdModuleSA(FpdModuleIdentification fpdModuleId) {\r
+        return fpdModuleSA.containsKey(fpdModuleId);\r
+    }\r
+\r
     /**\r
       Query overrided module surface area information. If current is Package\r
       or Platform build, also include the information from FPD file. \r
@@ -693,7 +693,8 @@ public class GlobalData {
         String[] commands = getToolChainInfo().getCommands();\r
 \r
         for (int i = 0; i < commands.length; ++i) {\r
-            if (toolsDef.getConfig().get(new String[] {target, toolchain, arch, commands[i], ToolChainAttribute.NAME.toString()}) != null) {\r
+            String cmdName = toolsDef.getConfig().get(new String[] {target, toolchain, arch, commands[i], ToolChainAttribute.NAME.toString()});\r
+            if (cmdName != null && cmdName.length() != 0) {\r
                 return true;\r
             }\r
         }\r