diff options
author | qouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-10 12:51:19 +0000 |
---|---|---|
committer | qouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-10 12:51:19 +0000 |
commit | a1ffb10f211fa712dfd6d54156a412cce24014f4 (patch) | |
tree | b3f3c2707a24c68aa327f1d2e14f6e73cb9ea7fd /Tools/Source/GenBuild | |
parent | 54aa8673cb7f643d78ef7690a0f9e9f33b39f0c0 (diff) | |
download | edk2-platforms-a1ffb10f211fa712dfd6d54156a412cce24014f4.tar.xz |
Support calling customized compression tool in FrameworkTask.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1506 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/GenBuild')
-rw-r--r-- | Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java | 60 |
1 files changed, 49 insertions, 11 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java index a098719073..3a67e6eb34 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java +++ b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java @@ -238,7 +238,9 @@ public class FfsProcess { **/
private void dealSections(int mode, Document doc, Element root, XmlCursor cursor, Vector<String> list) {
String type = cursor.getAttributeText(new QName("EncapsulationType"));
- if (type == null) {
+ String toolName = cursor.getAttributeText(new QName("ToolName"));
+ String sectType = cursor.getAttributeText(new QName("SectionType"));
+ if (type == null && sectType == null) {
if (cursor.toFirstChild()) {
do {
if (cursor.getName().getLocalPart().equalsIgnoreCase("Section")) {
@@ -255,33 +257,69 @@ public class FfsProcess { return;
}
Element ele;
- if (type.equalsIgnoreCase("COMPRESS")) {
+ Element toolEle = null;
+ if (type.equalsIgnoreCase("COMPRESS") && (toolName == null || toolName.equalsIgnoreCase(""))) {
mode = MODE_COMPRESS;
//
- // <compress compressName = "dummy">
- //
- ele = doc.createElement("compress");
- ele.setAttribute("compressName", "dummy");
+ // <gensection sectiontype="EFI_SECTION_COMPRESSION">
+ //
+ ele = doc.createElement("gensection");
+ ele.setAttribute("sectionType", "EFI_SECTION_COMPRESSION");
+
} else {
mode = MODE_GUID_DEFINED;
//
+ // <gensection sectiontype="EFI_SECTION_GUID_DEFINED">
+ //
+ ele = doc.createElement("gensection");
+ if (type != null) {
+ ele.setAttribute("sectiontype", "EFI_SECTION_GUID_DEFINED");
+ } else {
+ ele.setAttribute("sectiontype", sectType);
+ }
+ //
// <tool toolName="${OEMTOOLPATH}\toolname"
// outputPath = "${DEST_DIR_OUTPUT}">
//
- ele = doc.createElement("tool");
- ele.setAttribute("toolName", "${WORKSPACE_DIR}" + File.separatorChar + "Tools" + File.separatorChar + "bin"
+ toolEle = doc.createElement("tool");
+ if (toolName == null || toolName.equalsIgnoreCase("")) {
+ toolEle.setAttribute("toolName", "${WORKSPACE_DIR}" + File.separatorChar + "Tools" + File.separatorChar + "bin"
+ File.separatorChar + "GenCRC32Section");
- ele.setAttribute("outputPath", "${DEST_DIR_OUTPUT}");
+ }else{
+ File toolExe = new File(toolName);
+ //
+ // If <Tool> element exist, add sub element under <tool> .
+ //
+ if (toolExe.isAbsolute()) {
+ toolEle.setAttribute("toolName", toolName);
+ } else {
+ toolEle.setAttribute("toolName", "${WORKSPACE_DIR}" + File.separatorChar + "Tools" + File.separatorChar + "bin"
+ + File.separatorChar + toolName);
+ }
+ }
+
+ toolEle.setAttribute("outputPath", "${DEST_DIR_OUTPUT}");
+ ele.appendChild(toolEle);
}
if (cursor.toFirstChild()) {
do {
if (cursor.getName().getLocalPart().equalsIgnoreCase("Section")) {
cursor.push();
- dealSection(mode, doc, ele, cursor, list);
+ if (toolEle == null) {
+ dealSection(mode, doc, ele, cursor, list);
+ } else {
+ dealSection(mode, doc, toolEle, cursor, list);
+ }
+
cursor.pop();
} else if (cursor.getName().getLocalPart().equalsIgnoreCase("Sections")) {
cursor.push();
- dealSections(mode, doc, ele, cursor, list);
+ if (toolEle == null) {
+ dealSections(mode, doc, ele, cursor, list);
+ } else {
+ dealSections(mode, doc, toolEle, cursor, list);
+ }
+
cursor.pop();
}
} while (cursor.toNextSibling());
|