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=7e1e2c68523d31f9e0b2f94c340473a6aa42329e;hp=9778eaf8a042104db28a157d0206e85adec4e55a;hb=83fba802560b3446de68ac1c280773cf1a4271be;hpb=825168879302d78f47b0f1dea6009aecae0b62de diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java index 9778eaf8a0..7e1e2c6852 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java +++ b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java @@ -23,7 +23,6 @@ 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; @@ -57,9 +56,6 @@ import org.tianocore.build.toolchain.ToolChainMap; @since GenBuild 1.0 **/ public class GlobalData { - - public static Logger log = Logger.getAnonymousLogger(); - /// /// Record current WORKSPACE Directory /// @@ -164,7 +160,11 @@ public class GlobalData { // File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename); System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "]."); - toolsDef = new ToolChainConfig(toolsDefFile); + try { + toolsDef = new ToolChainConfig(toolsDefFile); + } catch (Exception e) { + throw new BuildException(e.getMessage()); + } // // Parse Framework Database @@ -185,7 +185,7 @@ public class GlobalData { List packages = db.getFrameworkDatabase().getPackageList().getFilenameList(); Iterator iter = packages.iterator(); while (iter.hasNext()) { - String fileName = iter.next().getStringValue(); + String fileName = iter.next().getStringValue().trim(); Spd spd = new Spd(new File(workspaceDir + File.separatorChar + fileName)); packageList.add(spd.getPackageId()); spdTable.put(spd.getPackageId(), spd); @@ -199,7 +199,7 @@ public class GlobalData { List platforms = db.getFrameworkDatabase().getPlatformList().getFilenameList(); Iterator iter = platforms.iterator(); while (iter.hasNext()) { - String fileName = iter.next().getStringValue(); + String fileName = iter.next().getStringValue().trim(); File fpdFile = new File(workspaceDir + File.separatorChar + fileName); if ( !fpdFile.exists() ) { throw new BuildException("Platform file [" + fpdFile.getPath() + "] not exists. "); @@ -219,8 +219,8 @@ public class GlobalData { // Map fpdDocMap = new HashMap(); fpdDocMap.put("PlatformSurfaceArea", fpdDoc); - SurfaceAreaQuery.setDoc(fpdDocMap); - PlatformIdentification platformId = SurfaceAreaQuery.getFpdHeader(); + SurfaceAreaQuery saq = new SurfaceAreaQuery(fpdDocMap); + PlatformIdentification platformId = saq.getFpdHeader(); platformId.setFpdFile(fpdFile); platformList.add(platformId); } @@ -412,7 +412,7 @@ public class GlobalData { return msaMap; } catch (Exception ex){ - throw new BuildException(ex.getMessage()); + throw new BuildException("Parsing MSA file [" + msaFile.getPath() + "] error. \n" + ex.getMessage() ); } } @@ -540,7 +540,6 @@ public class GlobalData { } } return null; - } /** @@ -599,7 +598,7 @@ public class GlobalData { return packageId; } } - throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!"); + throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!"); } public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException { @@ -607,7 +606,7 @@ public class GlobalData { moduleId.setPackage(packageId); Spd spd = spdTable.get(packageId); if (spd == null) { - throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!"); + throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!"); } Set modules = spd.getModules(); Iterator iter = modules.iterator(); @@ -620,7 +619,7 @@ public class GlobalData { return moduleId; } } - throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!"); + throw new BuildException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!"); } public synchronized static Set getPackageList(){ @@ -650,10 +649,10 @@ public class GlobalData { return result; } - ////// Tool Chain Related, try to refine and put some logic process to ToolChainFactory - + /// + /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory + /// public static ToolChainInfo getToolChainInfo() { -// GlobalData.log.info(toolsDef.getConfigInfo() + "" + toolChainEnvInfo + toolChainPlatformInfo); if (toolChainInfo == null) { toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo); if (toolChainPlatformInfo != null) { @@ -661,13 +660,12 @@ public class GlobalData { } toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands()); toolChainInfo.normalize(); - GlobalData.log.info(toolChainInfo + ""); + System.out.println("Current build tool chain information summary: "); + System.out.println(toolChainInfo + ""); } return toolChainInfo; } - - public static void setPlatformToolChainFamilyOption(ToolChainMap map) { platformToolChainFamilyOption = map; }