]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Fixed a bug which will cause single module build fail
[mirror_edk2.git] / Tools / Java / Source / GenBuild / org / tianocore / build / global / GlobalData.java
index 96558876e4b0f08a765353381db20db58c31f8ce..f941f4d03d42cbae020914adaca5f3b5d82ac211 100644 (file)
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
+import org.apache.tools.ant.Project;\r
 import org.apache.xmlbeans.XmlException;\r
 import org.apache.xmlbeans.XmlObject;\r
 import org.apache.xmlbeans.XmlOptions;\r
@@ -146,7 +147,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 EdkException {\r
+    public synchronized static void initInfo(Project prj, String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename ) throws EdkException {\r
         //\r
         // ensure this method will be revoked only once\r
         //\r
@@ -169,7 +170,7 @@ public class GlobalData {
         //\r
         File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);\r
         EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Using tool definition file [" + toolsDefFile.getPath() + "].");\r
-        toolsDef = new ToolChainConfig(toolsDefFile);\r
+        toolsDef = new ToolChainConfig(prj, toolsDefFile);\r
 \r
         //\r
         // Parse Framework Database\r
@@ -301,19 +302,20 @@ public class GlobalData {
         PackageIdentification packageId = null;\r
         Iterator iter = packageList.iterator();\r
         while (iter.hasNext()) {\r
-            packageId = (PackageIdentification)iter.next();\r
-            moduleId.setPackage(packageId);\r
-            Spd spd = spdTable.get(packageId);\r
+            PackageIdentification pid = (PackageIdentification)iter.next();\r
+            moduleId.setPackage(pid);\r
+            Spd spd = spdTable.get(pid);\r
             File tempMsaFile = null;\r
             if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {\r
                 if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {\r
+                    packageId = pid;\r
                     break ;\r
                 }\r
                 tempMsaFile = null;\r
             }\r
         }\r
         if (packageId == null){\r
-            throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any SPD package!");\r
+            throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any package!");\r
         } else {\r
             return packageId;\r
         }\r
@@ -647,7 +649,7 @@ public class GlobalData {
                 return moduleId;\r
             }\r
         }\r
-        throw new EdkException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!");\r
+        throw new EdkException("Can't find " + moduleId + " under the current workspace!");\r
     }\r
 \r
     public synchronized static Set<PackageIdentification> getPackageList(){\r