]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Report error messages more precise.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / GlobalData.java
index 9778eaf8a042104db28a157d0206e85adec4e55a..74a2d4fe435987ffe6758d044d583e32068b8e44 100644 (file)
@@ -23,7 +23,6 @@ import java.util.Iterator;
 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
@@ -57,9 +56,6 @@ import org.tianocore.build.toolchain.ToolChainMap;
   @since GenBuild 1.0\r
 **/\r
 public class GlobalData {\r
-\r
-    public static Logger log = Logger.getAnonymousLogger();\r
-\r
     ///\r
     /// Record current WORKSPACE Directory\r
     ///\r
@@ -164,7 +160,11 @@ public class GlobalData {
         //\r
         File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
         System.out.println("Using tool definiton file [" + toolsDefFile.getPath() + "].");\r
-        toolsDef = new ToolChainConfig(toolsDefFile);\r
+        try {\r
+            toolsDef = new ToolChainConfig(toolsDefFile);\r
+        } catch (Exception e) {\r
+            throw new BuildException(e.getMessage());\r
+        }\r
 \r
         //\r
         // Parse Framework Database\r
@@ -412,7 +412,7 @@ public class GlobalData {
             return msaMap;\r
         }\r
         catch (Exception ex){\r
-            throw new BuildException(ex.getMessage());\r
+            throw new BuildException("Parsing MSA file [" + msaFile.getPath() + "] error. \n" + ex.getMessage() );\r
         }\r
     }\r
 \r
@@ -540,7 +540,6 @@ public class GlobalData {
             }\r
         }\r
         return null;\r
-\r
     }\r
 \r
     /**\r
@@ -599,7 +598,7 @@ public class GlobalData {
                 return packageId;\r
             }\r
         }\r
-        throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");\r
+        throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!");\r
     }\r
 \r
     public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws BuildException {\r
@@ -607,7 +606,7 @@ public class GlobalData {
         moduleId.setPackage(packageId);\r
         Spd spd = spdTable.get(packageId);\r
         if (spd == null) {\r
-            throw new BuildException("Can't find package GUID value " + packageId.getGuid() + " in the current workspace!");\r
+            throw new BuildException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!");\r
         }\r
         Set<ModuleIdentification> modules = spd.getModules();\r
         Iterator<ModuleIdentification> iter = modules.iterator();\r
@@ -620,7 +619,7 @@ public class GlobalData {
                 return moduleId;\r
             }\r
         }\r
-        throw new BuildException("Can't find module GUID value " + moduleId.getGuid() + " in package, " + packageId + ", in the current workspace!");\r
+        throw new BuildException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!");\r
     }\r
 \r
     public synchronized static Set<PackageIdentification> getPackageList(){\r
@@ -650,10 +649,10 @@ public class GlobalData {
         return result;\r
     }\r
 \r
-    ////// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
-\r
+    ///\r
+    /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
+    ///\r
     public static ToolChainInfo getToolChainInfo() {\r
-//        GlobalData.log.info(toolsDef.getConfigInfo() + "" + toolChainEnvInfo + toolChainPlatformInfo);\r
         if (toolChainInfo == null) {\r
             toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
             if (toolChainPlatformInfo != null) {\r
@@ -661,13 +660,12 @@ public class GlobalData {
             }\r
             toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
             toolChainInfo.normalize();\r
-            GlobalData.log.info(toolChainInfo + "");\r
+            System.out.println("Current build tool chain information summary: ");\r
+            System.out.println(toolChainInfo + "");\r
         }\r
         return toolChainInfo;\r
     }\r
 \r
-\r
-\r
     public static void setPlatformToolChainFamilyOption(ToolChainMap map) {\r
         platformToolChainFamilyOption = map;\r
     }\r