summaryrefslogtreecommitdiff
path: root/Tools/Source
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-04-28 13:52:29 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-04-28 13:52:29 +0000
commit3d52de132fe23d3deaadfa6ea0d41353aff4e244 (patch)
tree310436e230b685f53594bdef1d5d3294008a4d8d /Tools/Source
parent2a8b1c0a8ae098a7fad79ee636aa9b2f4f2ceaaf (diff)
downloadedk2-platforms-3d52de132fe23d3deaadfa6ea0d41353aff4e244.tar.xz
Fix two bugs for current PCD workflow:
1) Switch build message on for PCD action. 2) If SPD file does *not* contains PCD information, it is illegal. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@76 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java2
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/action/BuildAction.java9
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java32
3 files changed, 23 insertions, 20 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
index 99b7242ebc..1de29ea373 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
@@ -799,7 +799,7 @@ public class FpdParserTask extends Task {
collectAction.perform (
getProject().getProperty("WORKSPACE_DIR"),
fpdFilename.getPath(),
- ActionMessage.NULL_MESSAGE_LEVEL
+ ActionMessage.MAX_MESSAGE_LEVEL
);
} catch (Exception exp) {
throw new BuildException (exp.getMessage());
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/BuildAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/BuildAction.java
index c8b0d9dba1..270b393a82 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/BuildAction.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/BuildAction.java
@@ -17,6 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
package org.tianocore.build.pcd.action;
import org.apache.tools.ant.Task;
+import org.apache.tools.ant.Project;
import org.tianocore.build.pcd.exception.BuildActionException;
/** BuildAction is the parent class for all action related to ant Task. This class will
@@ -68,9 +69,7 @@ abstract class BuildAction extends Task {
//
// Comment following code because in console debug environment, we can't
// get Project instance.
- //((Task) action).log(errorText, Project.MSG_INFO);
- //
- System.out.println(logStr);
+ ((Task) action).log(logStr, Project.MSG_INFO);
}
/**
@@ -87,9 +86,7 @@ abstract class BuildAction extends Task {
//
// Comment following code because in console debug environment, we can't
// get Project instance.
- //((Task) action).log(warningText, Project.MSG_WARN);
- //
- System.out.println(warningStr);
+ ((Task) action).log(warningStr, Project.MSG_WARN);
}
/**
diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
index 055563df1b..9929005872 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
@@ -501,7 +501,8 @@ public class CollectPCDAction {
token.skuDataArrayEnabled = pcdBuildData.getSkuDataArrayEnable();
token.assignedtokenNumber = Integer.decode(pcdBuildData.getToken().getStringValue());
skuDataArray = pcdBuildData.getSkuDataArray1();
-
+ token.datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
+
if(skuDataArray != null) {
for(skuIndex = 0; skuIndex < skuDataArray.size(); skuIndex ++) {
//
@@ -550,11 +551,12 @@ public class CollectPCDAction {
private void updateTokenBySPD(UsageInstance usageInstance,
String packageFullPath)
throws EntityException {
- PackageSurfaceAreaDocument pkgDoc = null;
- List<PcdDefinitions.PcdEntry> pcdEntryArray = new ArrayList<PcdDefinitions.PcdEntry>();
- int index;
- boolean isFoundInSpd = false;
- Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
+ PackageSurfaceAreaDocument pkgDoc = null;
+ PcdDefinitions pcdDefinitions = null;
+ List<PcdDefinitions.PcdEntry> pcdEntryArray = new ArrayList<PcdDefinitions.PcdEntry>();
+ int index = 0;
+ boolean isFoundInSpd = false;
+ Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
try {
pkgDoc =(PackageSurfaceAreaDocument)XmlObject.Factory.parse(new File(packageFullPath));
@@ -563,8 +565,18 @@ public class CollectPCDAction {
} catch(XmlException xmlE) {
throw new EntityException("Can't parse the FPD xml fle:" + packageFullPath);
}
+ pcdDefinitions = pkgDoc.getPackageSurfaceArea().getPcdDefinitions();
+ //
+ // It is illege for SPD file does not contains any PCD information.
+ //
+ if (pcdDefinitions == null) {
+ return;
+ }
- pcdEntryArray = pkgDoc.getPackageSurfaceArea().getPcdDefinitions().getPcdEntryList();
+ pcdEntryArray = pcdDefinitions.getPcdEntryList();
+ if (pcdEntryArray == null) {
+ return;
+ }
for(index = 0; index < pcdEntryArray.size(); index ++) {
if(pcdEntryArray.get(index).getCName().equalsIgnoreCase(
usageInstance.parentToken.cName)) {
@@ -616,12 +628,6 @@ public class CollectPCDAction {
}
}
}
-
- if(!isFoundInSpd ) {
- ActionMessage.warning(this,
- "Can *not* find the PCD token " + usageInstance.parentToken.cName +
- " in SPD file!");
- }
}
/**