diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-28 16:44:52 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-28 16:44:52 +0000 |
commit | a1eb640176c7a3b9d9981272c49824cbdb5ac15a (patch) | |
tree | 3e3a2bc715c2e5ab39a0444ad33d418296669450 /Tools | |
parent | fd16c6d5d404091051d010fe52a69196c9b89f1e (diff) | |
download | edk2-platforms-a1eb640176c7a3b9d9981272c49824cbdb5ac15a.tar.xz |
There is a rule here:
If a module link a library instance, all pcds defined by library instance should be instanted in module's <ModuleSA> in FPD file.
I add more checking code follows above rules.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1141 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java index 7f955ff040..ad4ebe78af 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java @@ -382,7 +382,9 @@ private UUID translateSchemaStringToUUID(String uuidString) String guidStringCName = null;
String guidString = null;
UsageInstance usageInstance = null;
+ boolean found = false;
+ usageInstanceArray = null;
if (!isBuildUsedLibrary) {
usageInstanceArray = dbManager.getUsageInstanceArrayByModuleName(moduleName,
moduleGuid,
@@ -392,10 +394,10 @@ private UUID translateSchemaStringToUUID(String uuidString) version);
dbManager.UsageInstanceContext = usageInstanceArray;
dbManager.CurrentModuleName = moduleName;
- } else {
+ } else if ((pcdNameArray != null) && (pcdNameArray.length > 0)) {
usageContext = dbManager.UsageInstanceContext;
//
- // For building MDE package, although all module are library, but PCD entries of
+ // For building library package, although all module are library, but PCD entries of
// these library should be used to autogen.
//
if (usageContext == null) {
@@ -407,24 +409,43 @@ private UUID translateSchemaStringToUUID(String uuidString) version);
} else {
usageInstanceArray = new ArrayList<UsageInstance>();
+
//
- // Remove PCD entries which are not belong to this library.
+ // Try to find all PCD defined in library's PCD in all <PcdEntry> in module's
+ // <ModuleSA> in FPD file.
//
- for (index = 0; index < usageContext.size(); index++) {
- if ((pcdNameArray == null) || (pcdNameArray.length == 0)){
- break;
- }
-
- for (index2 = 0; index2 < pcdNameArray.length; index2 ++) {
- if (pcdNameArray[index2].equalsIgnoreCase(usageContext.get(index).parentToken.cName)) {
- usageInstanceArray.add(usageContext.get(index));
+ for (index = 0; index < pcdNameArray.length; index++) {
+ found = false;
+ for (index2 = 0; index2 < usageContext.size(); index2 ++) {
+ if (pcdNameArray[index].equalsIgnoreCase(usageContext.get(index2).parentToken.cName)) {
+ usageInstanceArray.add(usageContext.get(index2));
+ found = true;
break;
}
}
+
+ if (!found) {
+ //
+ // All library's PCD should instanted in module's <ModuleSA> who
+ // use this library instance. If not, give errors.
+ //
+ throw new BuildActionException (String.format("[PCD Autogen Error] Module %s use library instance %s, the PCD %s " +
+ "is required by this library instance, but can not find " +
+ "it in the %s's <ModuleSA> in FPD file!",
+ dbManager.CurrentModuleName,
+ moduleName,
+ pcdNameArray[index],
+ dbManager.CurrentModuleName
+ ));
+ }
}
}
}
+ if (usageInstanceArray == null) {
+ return;
+ }
+
//
// Generate all PCD entry for a module.
//
|