Disp dependencies in error in case of circular dependency
authortgingold <tgingold@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Jan 2007 23:22:29 +0000 (23:22 +0000)
committertgingold <tgingold@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 12 Jan 2007 23:22:29 +0000 (23:22 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2245 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java

index 37c54f5..042f044 100644 (file)
@@ -231,17 +231,28 @@ public class AutogenLibOrder {
         //\r
         // Append the remaining library instance to the end of sorted list\r
         //\r
         //\r
         // Append the remaining library instance to the end of sorted list\r
         //\r
+       boolean HasError = false;\r
         for (int i = 0; i < libInstanceList.length; ++i) {\r
         for (int i = 0; i < libInstanceList.length; ++i) {\r
-            if (libInstanceConsumedBy.get(libInstanceList[i]).size() > 0 && libInstanceList[i].hasConstructor()) {\r
+           HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstanceList[i]);\r
+            if (consumedBy.size() > 0 && libInstanceList[i].hasConstructor()) {\r
                 EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName()\r
                            + " with constructor has a circular dependency!");\r
                 EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName()\r
                            + " with constructor has a circular dependency!");\r
-                throw new AutoGenException("Circular dependency in library instances is found!");\r
+               ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]);\r
+               for (int j = 0; j < consumedByList.length; ++j) {\r
+                   EdkLog.log(EdkLog.EDK_ERROR,\r
+                              " consumed by " + consumedByList[j].getName());\r
+               }\r
+               HasError = true;\r
             }\r
 \r
             if (!orderList.contains(libInstanceList[i])) {\r
                 orderList.add(libInstanceList[i]);\r
             }\r
         }\r
             }\r
 \r
             if (!orderList.contains(libInstanceList[i])) {\r
                 orderList.add(libInstanceList[i]);\r
             }\r
         }\r
+       if (HasError) {\r
+           throw new AutoGenException("Circular dependency in library instances is found!");\r
+       }\r
+\r
         return orderList;\r
     }\r
 }\r
         return orderList;\r
     }\r
 }\r