summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-19 05:44:44 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-19 05:44:44 +0000
commite64c74dd8c7c3534e8b3a40da63400abe8383db0 (patch)
tree3a6be84cdbc9115b31edebb0ff09b3add525bd21
parent2a870f53488e79e478317dbb2114cad9bf56cfe7 (diff)
downloadedk2-e64c74dd8c7c3534e8b3a40da63400abe8383db0.tar.gz
edk2-e64c74dd8c7c3534e8b3a40da63400abe8383db0.tar.bz2
edk2-e64c74dd8c7c3534e8b3a40da63400abe8383db0.zip
Add checking for whether module's FfsFormatKey is specified or not. For driver, fail build if can't find FfsFormatKey in FPD.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1041 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java43
1 files changed, 7 insertions, 36 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
index 6660382e64..641234e1e9 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java
@@ -163,45 +163,16 @@ public class FfsProcess {
}
//
- // if module specify sections itself, it's okay
- // otherwise find sections from WORKSPACE default setting with
- // ComponentType
+ // If FfsFormatKey is not null, report exception and fail build
+ // Otherwise report warning message
//
- if (ffs == null) {
- File file = new File(project.getProperty("COMMON_FILE"));
- //
- // if common file is not existed, just return
- //
- if (!file.exists()) {
- return false;
- }
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- try {
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- InputStream is = new FileInputStream(file);
- Document doc = dombuilder.parse(is);
- Element root = doc.getDocumentElement();
- NodeList items = root.getChildNodes();
- for (int i = 0; i < items.getLength(); i++) {
- Node node = items.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = node.getNodeName();
- if (nodeName.equalsIgnoreCase("Ffs")) {
- NamedNodeMap attr = node.getAttributes();
- Node type = attr.getNamedItem("type");
- if (type != null) {
- if (isMatch(type.getTextContent(), buildType)) {
- ffs = node;
- return true;
- }
- }
- }
- }
- }
- } catch (Exception e) {
- throw new BuildException("Parse COMMON_FILE [" + file.getPath() + "] error!\n" + e.getMessage());
+ if (buildType == null) {
+ System.out.println("Warning: this module doesn't specify a FfsFormatKey. ");
}
+ else {
+ throw new BuildException("Can't find FfsFormatKey [" + buildType + "] in FPD file. ");
}
+
if (ffs == null) {
return false;
} else {