summaryrefslogtreecommitdiff
path: root/Tools/Source
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-13 03:25:23 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-13 03:25:23 +0000
commit89e1408fde55d578276060985823e162ba31d6a5 (patch)
treec6a0261e527c7f94a8b0981a0e44d4976df0932a /Tools/Source
parent905dd497d2d481c50ff4856f06322309956fb068 (diff)
downloadedk2-89e1408fde55d578276060985823e162ba31d6a5.zip
edk2-89e1408fde55d578276060985823e162ba31d6a5.tar.gz
edk2-89e1408fde55d578276060985823e162ba31d6a5.tar.bz2
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
Diffstat (limited to 'Tools/Source')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java3
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java24
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java1
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java8
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java4
5 files changed, 30 insertions, 10 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
index 7990989..b053bdd 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
@@ -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);
diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
index 88d7e62..d70166d 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
@@ -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;
}
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java b/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
index 93ed51e..7091314 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
@@ -271,5 +271,4 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
public void setId(FpdModuleIdentification id) {
this.id = id;
}
-
} \ No newline at end of file
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
index 715e0ce..e52070c 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
@@ -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){
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
index daf2309..3736335 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
@@ -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