From 253d2919cd1ad0ee4365b5a57e990287e08d5c97 Mon Sep 17 00:00:00 2001 From: jwang36 Date: Tue, 27 Mar 2007 03:05:30 +0000 Subject: Fixed an Autogen issue which will cause build break when encountering some kind of module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2507 6f19259b-4bc3-4df7-8a09-765794883524 --- .../org/tianocore/build/FrameworkBuildTask.java | 24 ++++++++++++++++------ .../tianocore/build/autogen/AutogenLibOrder.java | 12 +++++++---- 2 files changed, 26 insertions(+), 10 deletions(-) (limited to 'Tools/Java/Source/GenBuild') diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java index ae1ac7ec93..8482401bb0 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java @@ -120,32 +120,44 @@ public class FrameworkBuildTask extends Task{ // // Add more logic process here // - throw new BuildException(e.getMessage()); + BuildException buildException = new BuildException(e.getMessage()); + buildException.setStackTrace(e.getStackTrace()); + throw buildException; } catch (PcdAutogenException e) { // // Add more logic process here // - throw new BuildException(e.getMessage()); + BuildException buildException = new BuildException(e.getMessage()); + buildException.setStackTrace(e.getStackTrace()); + throw buildException; } catch (AutoGenException e) { // // Add more logic process here // - throw new BuildException(e.getMessage()); + BuildException buildException = new BuildException(e.getMessage()); + buildException.setStackTrace(e.getStackTrace()); + throw buildException; } catch (PlatformPcdPreprocessBuildException e) { // // Add more logic process here // - throw new BuildException(e.getMessage()); + BuildException buildException = new BuildException(e.getMessage()); + buildException.setStackTrace(e.getStackTrace()); + throw buildException; } catch (GenBuildException e) { // // Add more logic process here // - throw new BuildException(e.getMessage()); + BuildException buildException = new BuildException(e.getMessage()); + buildException.setStackTrace(e.getStackTrace()); + throw buildException; } catch (EdkException e) { // // Add more logic process here // - throw new BuildException(e.getMessage()); + BuildException buildException = new BuildException(e.getMessage()); + buildException.setStackTrace(e.getStackTrace()); + throw buildException; } } diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java index 7e87e28ba3..a131b89cc8 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java @@ -158,7 +158,11 @@ public class AutogenLibOrder { // First, add the library instance without consumers to the Q // for (int i = 0; i < libInstanceList.length; ++i) { - if (libInstanceConsumedBy.get(libInstanceList[i]).size() == 0) { + if (libInstanceList[i] == null) { + continue; + } + + if (libInstanceConsumedBy.get(libInstanceList[i]) == null || libInstanceConsumedBy.get(libInstanceList[i]).size() == 0) { noConsumerList.add(libInstanceList[i]); } } @@ -174,7 +178,7 @@ public class AutogenLibOrder { continue; } HashSet consumedBy = libInstanceConsumedBy.get(m); - if (consumedBy.size() == 0) { + if (consumedBy == null || consumedBy.size() == 0) { continue; } @@ -194,7 +198,7 @@ public class AutogenLibOrder { } HashSet consumedBy = libInstanceConsumedBy.get(libInstance); - if (consumedBy.size() == 0) { + if (consumedBy == null || consumedBy.size() == 0) { continue; } @@ -234,7 +238,7 @@ public class AutogenLibOrder { boolean HasError = false; for (int i = 0; i < libInstanceList.length; ++i) { HashSet consumedBy = libInstanceConsumedBy.get(libInstanceList[i]); - if (consumedBy.size() > 0 && libInstanceList[i].hasConstructor()) { + if (consumedBy != null && consumedBy.size() > 0 && libInstanceList[i].hasConstructor()) { EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName() + " with constructor has a circular dependency!"); ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]); -- cgit v1.2.3