]> git.proxmox.com Git - mirror_edk2.git/commitdiff
To locate module precisely in stand-alone module build. Except Module Guid, add MSA...
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 13 Sep 2006 03:25:23 +0000 (03:25 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 13 Sep 2006 03:25:23 +0000 (03:25 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1521 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java

index 7990989d23ef0096d84b66803dee58d0cf39c0c8..b053bdd566787aa57d829906428840fa3de49fda 100644 (file)
@@ -130,6 +130,7 @@ public class GenBuildTask extends Ant {
               From module build, exception from module surface area invalid.\r
     **/\r
     public void execute() throws BuildException {\r
+        this.setTaskName("GenBuild");\r
         try {\r
             processGenBuild();\r
         } catch (PcdAutogenException e) {\r
@@ -200,6 +201,7 @@ public class GenBuildTask extends Ant {
             Map<String, XmlObject> doc = GlobalData.getNativeMsa(msaFile);\r
             saq = new SurfaceAreaQuery(doc);\r
             moduleId = saq.getMsaHeader();\r
+            moduleId.setMsaFile(msaFile);\r
         }\r
         \r
         String[] producedLibraryClasses = saq.getLibraryClasses("ALWAYS_PRODUCED",null);\r
@@ -346,7 +348,6 @@ public class GenBuildTask extends Ant {
     private void prepareSingleModuleBuild() throws EdkException {\r
         //\r
         // Find out the package which the module belongs to\r
-        // TBD: Enhance it!!!!\r
         //\r
         PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);\r
         GlobalData.refreshPackageIdentification(packageId);\r
index 88d7e62c8f5412ad8cb8213dfea51d6625968830..d70166dbaf5e0760daed812ca21a739247168688 100644 (file)
@@ -18,6 +18,7 @@ package org.tianocore.build.fpd;
 import java.io.BufferedWriter;\r
 import java.io.File;\r
 import java.io.FileWriter;\r
+import java.io.IOException;\r
 import java.util.HashMap;\r
 import java.util.Iterator;\r
 import java.util.LinkedHashMap;\r
@@ -30,6 +31,7 @@ import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;\r
 import org.apache.tools.ant.taskdefs.Ant;\r
 import org.apache.tools.ant.taskdefs.Property;\r
+import org.apache.xmlbeans.XmlException;\r
 import org.apache.xmlbeans.XmlObject;\r
 \r
 import org.tianocore.common.definitions.EdkDefinitions;\r
@@ -277,8 +279,10 @@ public class FpdParserTask extends Task {
                 bw.flush();\r
                 bw.close();\r
                 fw.close();\r
-            } catch (Exception e) {\r
-                throw new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + e.getMessage());\r
+            } catch (IOException ex) {\r
+                BuildException buildException = new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + ex.getMessage());\r
+                buildException.setStackTrace(ex.getStackTrace());\r
+                throw buildException;\r
             }\r
         }\r
     }\r
@@ -289,7 +293,7 @@ public class FpdParserTask extends Task {
       @throws BuildException\r
                   FPD file is not valid.\r
     **/\r
-    public void parseFpdFile(File fpdFile) throws BuildException {\r
+    public void parseFpdFile(File fpdFile) throws BuildException, EdkException {\r
         this.fpdFile = fpdFile;\r
         parseFpdFile();\r
     }\r
@@ -362,8 +366,18 @@ public class FpdParserTask extends Task {
             //\r
             PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();\r
             ca.perform(platformId.getFpdFile().getPath(), ActionMessage.NULL_MESSAGE_LEVEL);\r
-        } catch (Exception e) {\r
-            throw new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + e.getMessage());\r
+        } catch (IOException ex) {\r
+            BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
+            buildException.setStackTrace(ex.getStackTrace());\r
+            throw buildException;\r
+        } catch (XmlException ex) {\r
+            BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
+            buildException.setStackTrace(ex.getStackTrace());\r
+            throw buildException;\r
+        } catch (EdkException ex) {\r
+            BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
+            buildException.setStackTrace(ex.getStackTrace());\r
+            throw buildException;\r
         }\r
     }\r
 \r
index 93ed51e0f343380b92fb7c8d6bac942f4555a853..7091314c69baceba371c820f2b318438ac2f95ca 100644 (file)
@@ -271,5 +271,4 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
     public void setId(FpdModuleIdentification id) {\r
         this.id = id;\r
     }\r
-    \r
 }
\ No newline at end of file
index 715e0ce34e3fa748f153d92a50241441d251b205..e52070c2ce3191893fd5363e220c57b9e85ba594 100644 (file)
@@ -299,8 +299,12 @@ public class GlobalData {
             packageId = (PackageIdentification)iter.next();\r
             moduleId.setPackage(packageId);\r
             Spd spd = spdTable.get(packageId);\r
-            if (spd.getModuleFile(moduleId) != null ) {\r
-                break ;\r
+            File tempMsaFile = null;\r
+            if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {\r
+                if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {\r
+                    break ;\r
+                }\r
+                tempMsaFile = null;\r
             }\r
         }\r
         if (packageId == null){\r
index daf23092584cfc978e8286a94ba0c3caad957f4c..373633521e85b084418330b6342f4a1ccc3be23a 100644 (file)
@@ -1360,10 +1360,12 @@ public class SurfaceAreaQuery {
             //\r
             PackageIdentification pkgId = new PackageIdentification(null, pkgGuid, pkgVersion);\r
             GlobalData.refreshPackageIdentification(pkgId);\r
+            \r
             ModuleIdentification saId = new ModuleIdentification(null, saGuid, saVersion);\r
+            saId.setPackage(pkgId);\r
             GlobalData.refreshModuleIdentification(saId);\r
             \r
-            saId.setPackage(pkgId);\r
+\r
 \r
             //\r
             // Create FpdModule Identification which have class member of module\r