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
This commit is contained in:
jwang36
2007-03-27 03:05:30 +00:00
parent a5dd05b513
commit 253d2919cd
2 changed files with 26 additions and 10 deletions

View File

@ -120,32 +120,44 @@ public class FrameworkBuildTask extends Task{
// //
// Add more logic process here // 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) { } catch (PcdAutogenException e) {
// //
// Add more logic process here // 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) { } catch (AutoGenException e) {
// //
// Add more logic process here // 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) { } catch (PlatformPcdPreprocessBuildException e) {
// //
// Add more logic process here // 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) { } catch (GenBuildException e) {
// //
// Add more logic process here // 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) { } catch (EdkException e) {
// //
// Add more logic process here // Add more logic process here
// //
throw new BuildException(e.getMessage()); BuildException buildException = new BuildException(e.getMessage());
buildException.setStackTrace(e.getStackTrace());
throw buildException;
} }
} }

View File

@ -158,7 +158,11 @@ public class AutogenLibOrder {
// First, add the library instance without consumers to the Q // First, add the library instance without consumers to the Q
// //
for (int i = 0; i < libInstanceList.length; ++i) { 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]); noConsumerList.add(libInstanceList[i]);
} }
} }
@ -174,7 +178,7 @@ public class AutogenLibOrder {
continue; continue;
} }
HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(m); HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(m);
if (consumedBy.size() == 0) { if (consumedBy == null || consumedBy.size() == 0) {
continue; continue;
} }
@ -194,7 +198,7 @@ public class AutogenLibOrder {
} }
HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstance); HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstance);
if (consumedBy.size() == 0) { if (consumedBy == null || consumedBy.size() == 0) {
continue; continue;
} }
@ -234,7 +238,7 @@ public class AutogenLibOrder {
boolean HasError = false; boolean HasError = false;
for (int i = 0; i < libInstanceList.length; ++i) { for (int i = 0; i < libInstanceList.length; ++i) {
HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstanceList[i]); HashSet<ModuleIdentification> 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() EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName()
+ " with constructor has a circular dependency!"); + " with constructor has a circular dependency!");
ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]); ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]);