From 3790e93c7e9b5fb59721de2a54f7ea2afb8e915f Mon Sep 17 00:00:00 2001 From: wuyizhong Date: Wed, 30 Aug 2006 03:11:48 +0000 Subject: [PATCH] Add Arch Check for single module build. To Fix T167 & T224. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1404 6f19259b-4bc3-4df7-8a09-765794883524 --- .../org/tianocore/build/GenBuildTask.java | 3 +- .../tianocore/build/fpd/FpdParserTask.java | 40 ++++++++++++++++--- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java index 42d3313ad3..9b4dfa3486 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -342,7 +342,8 @@ public class GenBuildTask extends Ant { // FpdParserTask fpdParser = new FpdParserTask(); fpdParser.setProject(getProject()); - fpdParser.parseFpdFile(platformId.getFpdFile()); + fpdParser.parseFpdFile(platformId.getFpdFile(), moduleId); + PropertyManager.setProperty("ARCH", fpdParser.getAllArchForModule(moduleId)); // // Prepare for Platform related common properties diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java index f0b1f021b3..873da774e5 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java @@ -305,18 +305,21 @@ public class FpdParserTask extends Task { @throws BuildException FPD file is not valid. **/ - public void parseFpdFile(File fpdFile) throws BuildException { + public void parseFpdFile(File fpdFile, ModuleIdentification singleModuleId) throws BuildException { this.fpdFile = fpdFile; - parseFpdFile(); + parseFpdFile(singleModuleId); } + private void parseFpdFile() throws BuildException { + parseFpdFile(null); + } /** Parse FPD file. @throws BuildException FPD file is not valid. **/ - private void parseFpdFile() throws BuildException { + private void parseFpdFile(ModuleIdentification singleModuleId) throws BuildException { try { XmlObject doc = XmlObject.Factory.parse(fpdFile); @@ -356,7 +359,7 @@ public class FpdParserTask extends Task { // // Parse all list modules SA // - parseModuleSAFiles(); + parseModuleSAFiles(singleModuleId); // // TBD. Deal PCD and BuildOption related Info @@ -381,7 +384,7 @@ public class FpdParserTask extends Task { /** Parse all modules listed in FPD file. **/ - private void parseModuleSAFiles() throws EdkException{ + private void parseModuleSAFiles(ModuleIdentification singleModuleId) throws EdkException{ Map> moduleSAs = SurfaceAreaQuery.getFpdModules(); // @@ -392,10 +395,21 @@ public class FpdParserTask extends Task { while (iter.hasNext()) { FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next(); + // + // If is stand-alone module build, just parse this module, pass others + // + if (singleModuleId != null) { + // + // pass others modules + // + if ( ! fpdModuleId.getModule().equals(singleModuleId)) { + continue ; + } + } + // // Judge if Module is existed? // TBD - GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId)); // @@ -558,4 +572,18 @@ public class FpdParserTask extends Task { public void setType(String type) { this.type = type; } + + public String getAllArchForModule(ModuleIdentification moduleId) { + String archs = ""; + Iterator iter = outfiles.keySet().iterator(); + while (iter.hasNext()) { + FpdModuleIdentification fpdModuleId = iter.next(); + + if (fpdModuleId.getModule().equals(moduleId)) { + archs += fpdModuleId.getArch() + " "; + } + } + + return archs; + } } -- 2.39.2