To locate module precisely in stand-alone module build. Except Module Guid, add MSA file path to consider.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1521 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong 2006-09-13 03:25:23 +00:00
parent 905dd497d2
commit 89e1408fde
5 changed files with 30 additions and 10 deletions

View File

@ -130,6 +130,7 @@ public class GenBuildTask extends Ant {
From module build, exception from module surface area invalid.
**/
public void execute() throws BuildException {
this.setTaskName("GenBuild");
try {
processGenBuild();
} catch (PcdAutogenException e) {
@ -200,6 +201,7 @@ public class GenBuildTask extends Ant {
Map<String, XmlObject> doc = GlobalData.getNativeMsa(msaFile);
saq = new SurfaceAreaQuery(doc);
moduleId = saq.getMsaHeader();
moduleId.setMsaFile(msaFile);
}
String[] producedLibraryClasses = saq.getLibraryClasses("ALWAYS_PRODUCED",null);
@ -346,7 +348,6 @@ public class GenBuildTask extends Ant {
private void prepareSingleModuleBuild() throws EdkException {
//
// Find out the package which the module belongs to
// TBD: Enhance it!!!!
//
PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);
GlobalData.refreshPackageIdentification(packageId);

View File

@ -18,6 +18,7 @@ package org.tianocore.build.fpd;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
@ -30,6 +31,7 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Ant;
import org.apache.tools.ant.taskdefs.Property;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.tianocore.common.definitions.EdkDefinitions;
@ -277,8 +279,10 @@ public class FpdParserTask extends Task {
bw.flush();
bw.close();
fw.close();
} catch (Exception e) {
throw new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + e.getMessage());
} catch (IOException ex) {
BuildException buildException = new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + ex.getMessage());
buildException.setStackTrace(ex.getStackTrace());
throw buildException;
}
}
}
@ -289,7 +293,7 @@ public class FpdParserTask extends Task {
@throws BuildException
FPD file is not valid.
**/
public void parseFpdFile(File fpdFile) throws BuildException {
public void parseFpdFile(File fpdFile) throws BuildException, EdkException {
this.fpdFile = fpdFile;
parseFpdFile();
}
@ -362,8 +366,18 @@ public class FpdParserTask extends Task {
//
PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();
ca.perform(platformId.getFpdFile().getPath(), ActionMessage.NULL_MESSAGE_LEVEL);
} catch (Exception e) {
throw new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + e.getMessage());
} catch (IOException ex) {
BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
buildException.setStackTrace(ex.getStackTrace());
throw buildException;
} catch (XmlException ex) {
BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
buildException.setStackTrace(ex.getStackTrace());
throw buildException;
} catch (EdkException ex) {
BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
buildException.setStackTrace(ex.getStackTrace());
throw buildException;
}
}

View File

@ -271,5 +271,4 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
public void setId(FpdModuleIdentification id) {
this.id = id;
}
}

View File

@ -299,8 +299,12 @@ public class GlobalData {
packageId = (PackageIdentification)iter.next();
moduleId.setPackage(packageId);
Spd spd = spdTable.get(packageId);
if (spd.getModuleFile(moduleId) != null ) {
break ;
File tempMsaFile = null;
if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {
if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {
break ;
}
tempMsaFile = null;
}
}
if (packageId == null){

View File

@ -1360,10 +1360,12 @@ public class SurfaceAreaQuery {
//
PackageIdentification pkgId = new PackageIdentification(null, pkgGuid, pkgVersion);
GlobalData.refreshPackageIdentification(pkgId);
ModuleIdentification saId = new ModuleIdentification(null, saGuid, saVersion);
saId.setPackage(pkgId);
GlobalData.refreshModuleIdentification(saId);
saId.setPackage(pkgId);
//
// Create FpdModule Identification which have class member of module