X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fglobal%2FGlobalData.java;h=b02af3df664656e23442bac756f22bc38dc4fdcc;hp=51f198571a9241a11999f017d2697e3a75cdb242;hb=d14ebb43742f411f2a013996b8e76bcab2420552;hpb=23583a8891e878633a430212502dfa97fd143573 diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java index 51f198571a..b02af3df66 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java @@ -16,18 +16,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ package org.tianocore.build.global; +import java.io.File; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.logging.Logger; + import org.apache.tools.ant.BuildException; import org.apache.xmlbeans.XmlObject; import org.tianocore.DbPathAndFilename; import org.tianocore.FrameworkDatabaseDocument; import org.tianocore.ModuleSurfaceAreaDocument; -import org.tianocore.PcdBuildDefinitionDocument; import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea; import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.id.PlatformIdentification; -import org.tianocore.build.pcd.entity.MemoryDatabaseManager; +import org.tianocore.pcd.entity.MemoryDatabaseManager; import org.tianocore.build.toolchain.ToolChainAttribute; import org.tianocore.build.toolchain.ToolChainConfig; import org.tianocore.build.toolchain.ToolChainElement; @@ -37,15 +45,6 @@ import org.tianocore.build.toolchain.ToolChainMap; import org.tianocore.exception.EdkException; import org.tianocore.logger.EdkLog; -import java.io.File; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Logger; - /** GlobalData provide initializing, instoring, querying and update global data. It is a bridge to intercommunicate between multiple component, such as AutoGen, @@ -133,8 +132,6 @@ public class GlobalData { private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager(); - - /** Parse framework database (DB) and all SPD files listed in DB to initialize the environment for next build. This method will only be executed only once @@ -145,7 +142,7 @@ public class GlobalData { @throws BuildException Framework Dababase or SPD or MSA file is not valid **/ - public synchronized static void initInfo(String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename) throws BuildException { + public synchronized static void initInfo(String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename ) throws BuildException { // // ensure this method will be revoked only once // @@ -153,8 +150,8 @@ public class GlobalData { return; } globalFlag = true; - - // + + // // Backup workspace directory. It will be used by other method // GlobalData.workspaceDir = workspaceDir.replaceAll("(\\\\)", "/"); @@ -318,7 +315,11 @@ public class GlobalData { } fpdModuleSA.put(fpdModuleId, result); } - + + public synchronized static boolean hasFpdModuleSA(FpdModuleIdentification fpdModuleId) { + return fpdModuleSA.containsKey(fpdModuleId); + } + /** Query overrided module surface area information. If current is Package or Platform build, also include the information from FPD file. @@ -806,8 +807,8 @@ public class GlobalData { // // For PCD // - public synchronized static Map getFpdModuleSaXmlObject( - String xmlObjectName) { + public synchronized static Map + getFpdModuleSaXmlObject(String xmlObjectName) { Set fpdModuleSASet = fpdModuleSA.keySet(); Iterator item = fpdModuleSASet.iterator(); @@ -822,17 +823,20 @@ public class GlobalData { try{ if (SANode.get(xmlObjectName)!= null){ SAPcdBuildDef.put(moduleId, - (XmlObject) SANode - .get(xmlObjectName)); + (XmlObject) SANode.get(xmlObjectName)); } - - } catch (Exception e){ EdkLog.log(EdkLog.EDK_INFO, e.getMessage()); } - } + } return SAPcdBuildDef; } + + public synchronized static Map getFpdPcdBuildDefinitions() { + Map pcdBuildDef = getFpdModuleSaXmlObject ("PcdBuildDefinition"); + + return pcdBuildDef; + } }