mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
52ee46a69b
commit
3790e93c7e
|
@ -342,7 +342,8 @@ public class GenBuildTask extends Ant {
|
||||||
//
|
//
|
||||||
FpdParserTask fpdParser = new FpdParserTask();
|
FpdParserTask fpdParser = new FpdParserTask();
|
||||||
fpdParser.setProject(getProject());
|
fpdParser.setProject(getProject());
|
||||||
fpdParser.parseFpdFile(platformId.getFpdFile());
|
fpdParser.parseFpdFile(platformId.getFpdFile(), moduleId);
|
||||||
|
PropertyManager.setProperty("ARCH", fpdParser.getAllArchForModule(moduleId));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare for Platform related common properties
|
// Prepare for Platform related common properties
|
||||||
|
|
|
@ -305,18 +305,21 @@ public class FpdParserTask extends Task {
|
||||||
@throws BuildException
|
@throws BuildException
|
||||||
FPD file is not valid.
|
FPD file is not valid.
|
||||||
**/
|
**/
|
||||||
public void parseFpdFile(File fpdFile) throws BuildException {
|
public void parseFpdFile(File fpdFile, ModuleIdentification singleModuleId) throws BuildException {
|
||||||
this.fpdFile = fpdFile;
|
this.fpdFile = fpdFile;
|
||||||
parseFpdFile();
|
parseFpdFile(singleModuleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void parseFpdFile() throws BuildException {
|
||||||
|
parseFpdFile(null);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
Parse FPD file.
|
Parse FPD file.
|
||||||
|
|
||||||
@throws BuildException
|
@throws BuildException
|
||||||
FPD file is not valid.
|
FPD file is not valid.
|
||||||
**/
|
**/
|
||||||
private void parseFpdFile() throws BuildException {
|
private void parseFpdFile(ModuleIdentification singleModuleId) throws BuildException {
|
||||||
try {
|
try {
|
||||||
XmlObject doc = XmlObject.Factory.parse(fpdFile);
|
XmlObject doc = XmlObject.Factory.parse(fpdFile);
|
||||||
|
|
||||||
|
@ -356,7 +359,7 @@ public class FpdParserTask extends Task {
|
||||||
//
|
//
|
||||||
// Parse all list modules SA
|
// Parse all list modules SA
|
||||||
//
|
//
|
||||||
parseModuleSAFiles();
|
parseModuleSAFiles(singleModuleId);
|
||||||
|
|
||||||
//
|
//
|
||||||
// TBD. Deal PCD and BuildOption related Info
|
// TBD. Deal PCD and BuildOption related Info
|
||||||
|
@ -381,7 +384,7 @@ public class FpdParserTask extends Task {
|
||||||
/**
|
/**
|
||||||
Parse all modules listed in FPD file.
|
Parse all modules listed in FPD file.
|
||||||
**/
|
**/
|
||||||
private void parseModuleSAFiles() throws EdkException{
|
private void parseModuleSAFiles(ModuleIdentification singleModuleId) throws EdkException{
|
||||||
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();
|
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -392,10 +395,21 @@ public class FpdParserTask extends Task {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
|
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?
|
// Judge if Module is existed?
|
||||||
// TBD
|
// TBD
|
||||||
|
|
||||||
GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));
|
GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -558,4 +572,18 @@ public class FpdParserTask extends Task {
|
||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAllArchForModule(ModuleIdentification moduleId) {
|
||||||
|
String archs = "";
|
||||||
|
Iterator<FpdModuleIdentification> iter = outfiles.keySet().iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
FpdModuleIdentification fpdModuleId = iter.next();
|
||||||
|
|
||||||
|
if (fpdModuleId.getModule().equals(moduleId)) {
|
||||||
|
archs += fpdModuleId.getArch() + " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return archs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue