From e3cc406130b14c020c75e3a169f94ba001bf2128 Mon Sep 17 00:00:00 2001 From: jwang36 Date: Thu, 25 Jan 2007 01:25:02 +0000 Subject: - Fixed EDKT240. Now the Blank.pad file for alignment purpose will no longer be needed. - Fixed EDKT366. For NT32, using "build run" to launch the NT32 emulator. The run.cmd is still be generated in the ${TARGET_DIR} git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2305 6f19259b-4bc3-4df7-8a09-765794883524 --- .../GenBuild/org/tianocore/build/FfsProcess.java | 4 ++ .../org/tianocore/build/FrameworkBuildTask.java | 6 +-- .../GenBuild/org/tianocore/build/GenBuildTask.java | 24 +++++++-- .../build/fpd/PlatformBuildFileGenerator.java | 57 +++++++++++++++++++++- .../tianocore/build/global/SurfaceAreaQuery.java | 16 ++++++ 5 files changed, 96 insertions(+), 11 deletions(-) (limited to 'Tools/Java/Source/GenBuild') diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java index 884a0d7453..dd86346b7f 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java @@ -347,6 +347,7 @@ public class FfsProcess { **/ private void dealSection(int mode, Document doc, Element root, XmlCursor cursor, Vector list) { String type = cursor.getAttributeText(new QName("SectionType")); + String alignment = cursor.getAttributeText(new QName("Alignment")); // // Judge if file is specified? Yes, just use the file, else call Build Macro @@ -399,6 +400,9 @@ public class FfsProcess { } else { ele.setAttribute("fileName", fileName); } + if (alignment != null) { + ele.setAttribute("Alignment", alignment); + } root.appendChild(ele); } } diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java index e240150c29..ae1ac7ec93 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java @@ -323,11 +323,7 @@ public class FrameworkBuildTask extends Task{ } public void setType(String type) { - if (type.equalsIgnoreCase("clean") || type.equalsIgnoreCase("cleanall")) { - this.type = type.toLowerCase(); - } else { - this.type = "all"; - } + this.type = type.toLowerCase(); } private void readTargetFile() throws EdkException{ diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java index 2265d6ba05..5aa717fbdd 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -327,10 +327,8 @@ public class GenBuildTask extends Ant { if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) { applyBuild(targetList[i], toolchainList[j], fpdModuleId); - } else if (type.equalsIgnoreCase("clean")) { - applyClean(fpdModuleId); - } else if (type.equalsIgnoreCase("cleanall")) { - applyCleanall(fpdModuleId); + } else { + applyNonBuildTarget(fpdModuleId); } } } @@ -675,6 +673,24 @@ public class GenBuildTask extends Ant { antCall(antFilename, null); } + private void applyNonBuildTarget(FpdModuleIdentification fpdModuleId){ + // + // if it is CUSTOM_BUILD + // then call the exist BaseName_build.xml directly. + // + if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) { + EdkLog.log(this, "Calling user-defined " + moduleId.getName() + "_build.xml"); + + String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml"; + antCall(antFilename, this.type); + + return ; + } + + String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml"; + antCall(antFilename, this.type); + } + private void applyClean(FpdModuleIdentification fpdModuleId){ // // if it is CUSTOM_BUILD diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java index 1e5c7744b5..ad2ee2cdd2 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java @@ -159,7 +159,8 @@ public class PlatformBuildFileGenerator { // User Extension Post build // applyUserExtensionsPostBuild(document, root); - + applyUserExtensions(document, root); + document.appendChild(rootComment); document.appendChild(root); // @@ -630,7 +631,59 @@ public class PlatformBuildFileGenerator { root.appendChild(ele); } - + + private void applyUserExtensions(Document document, Node root) { + Node[] nodeList = saq.getFpdUserExtensions(); + for (int nodeIndex = 0; nodeIndex < nodeList.length; ++nodeIndex) { + Node node = nodeList[nodeIndex]; + // + // User Extensions + // + root.appendChild(document.createComment("User Defined Target")); + Element ele = document.createElement("target"); + ele.setAttribute("name", node.getAttributes().getNamedItem("Identifier").getNodeValue()); + + if (node != null) { + // + // For every Target and ToolChain + // + String[] targetList = GlobalData.getToolChainInfo().getTargets(); + for (int i = 0; i < targetList.length; i++){ + String[] toolchainList = GlobalData.getToolChainInfo().getTagnames(); + for(int j = 0; j < toolchainList.length; j++){ + // + // Prepare FV_DIR + // + String ffsCommonDir = project.getProperty("BUILD_DIR") + File.separatorChar + + targetList[i] + "_" + + toolchainList[j]; + File fvDir = new File(ffsCommonDir + File.separatorChar + "FV"); + Element fvEle = document.createElement("var"); + fvEle.setAttribute("name", "FV_DIR"); + fvEle.setAttribute("value", fvDir.getPath().replaceAll("(\\\\)", "/")); + ele.appendChild(fvEle); + + Element targetDirEle = document.createElement("var"); + targetDirEle.setAttribute("name", "TARGET_DIR"); + targetDirEle.setAttribute("value", ffsCommonDir.replaceAll("(\\\\)", "/")); + ele.appendChild(targetDirEle); + + NodeList childNodes = node.getChildNodes(); + for (int k = 0; k < childNodes.getLength(); k++) { + Node childItem = childNodes.item(k); + if (childItem.getNodeType() == Node.ELEMENT_NODE) { + ele.appendChild(recursiveNode(childItem, document)); + } + } + + } + } + } + + root.appendChild(ele); + } + } + private Element recursiveNode(Node node, Document document) { Element root = document.createElement(node.getNodeName()); NamedNodeMap attr = node.getAttributes(); diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index 36eda95c3f..b95c389592 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -1492,6 +1492,22 @@ public class SurfaceAreaQuery { return a.getDomNode(); } + public Node[] getFpdUserExtensions() { + String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and not(@Identifier='1') and not(@Identifier='0')]" }; + + Object[] queryResult = get("PlatformSurfaceArea", xPath); + if (queryResult == null || queryResult.length == 0) { + return new Node[0]; + } + + Node[] nodeList = new Node[queryResult.length]; + for (int i = 0; i < queryResult.length; ++i) { + UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[i]; + nodeList[i] = a.getDomNode(); + } + + return nodeList; + } /** * Retrieve FV image option information * -- cgit v1.2.3