]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fixed EDKT482. Added support for multiple msa files in the same directory.
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 Dec 2006 08:14:10 +0000 (08:14 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 Dec 2006 08:14:10 +0000 (08:14 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2079 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Application/HelloWorld/HelloWorld.msa
Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java

index ca75959684ece749fdfc3a0f19da5fc8282316f2..85e2db15d4ef44e80650f024632e4fb9f6f195b4 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
   <MsaHeader>\r
 <?xml version="1.0" encoding="UTF-8"?>\r
 <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
   <MsaHeader>\r
-    <ModuleName>Hello World UEFI Application</ModuleName>\r
+    <ModuleName>Hello_World_UEFI_Application</ModuleName>\r
     <ModuleType>UEFI_APPLICATION</ModuleType>\r
     <GuidValue>6987936E-ED34-44db-AE97-1FA5E4ED2116</GuidValue>\r
     <Version>1.0</Version>\r
     <ModuleType>UEFI_APPLICATION</ModuleType>\r
     <GuidValue>6987936E-ED34-44db-AE97-1FA5E4ED2116</GuidValue>\r
     <Version>1.0</Version>\r
@@ -48,4 +48,4 @@
       <ModuleEntryPoint>UefiMain</ModuleEntryPoint>\r
     </Extern>\r
   </Externs>\r
       <ModuleEntryPoint>UefiMain</ModuleEntryPoint>\r
     </Extern>\r
   </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+</ModuleSurfaceArea>\r
index 3d17befe1973b614b3c8a1af0dd79bc4f8ec3b1a..84e799d00c63245f1f5fcb8cd628752165e08a9c 100644 (file)
@@ -207,11 +207,10 @@ public class FrameworkBuildTask extends Task{
         // If find more than one FPD files, report error.  \r
         //\r
         File buildFile = null;\r
         // If find more than one FPD files, report error.  \r
         //\r
         File buildFile = null;\r
-        if (msaFiles.size() > 1) {\r
-            throw new BuildException("Found " + msaFiles.size() + " MSA files in current dir. ");\r
-        } else if (msaFiles.size() == 1 && activePlatform == null) {\r
-            throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. ");\r
-        } else if (msaFiles.size() == 1 && activePlatform != null) {\r
+        if (msaFiles.size() > 0) {\r
+            if (activePlatform == null) {\r
+                throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. ");\r
+            }\r
             //\r
             // Build the single module\r
             //\r
             //\r
             // Build the single module\r
             //\r
@@ -278,17 +277,21 @@ public class FrameworkBuildTask extends Task{
             }\r
             File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);\r
             EdkLog.log(this, "Using the FPD file [" + tmpFile.getPath() + "] for the active platform. ");\r
             }\r
             File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);\r
             EdkLog.log(this, "Using the FPD file [" + tmpFile.getPath() + "] for the active platform. ");\r
-            EdkLog.log(this, "Processing the MSA file [" + buildFile.getPath() + "] ..>> ");\r
-            GenBuildTask genBuildTask = new GenBuildTask();\r
-            genBuildTask.setSingleModuleBuild(true);\r
-            genBuildTask.setType(type);\r
-            getProject().setProperty("PLATFORM_FILE", activePlatform);\r
-            if( !multithread) {\r
-                originalProperties.put("PLATFORM_FILE", activePlatform);\r
+\r
+            File[] moduleFiles = msaFiles.toArray(new File[msaFiles.size()]);\r
+            for (int i = 0; i < moduleFiles.length; ++i) {\r
+                EdkLog.log(this, "Processing the MSA file [" + moduleFiles[i].getPath() + "] ..>> ");\r
+                GenBuildTask genBuildTask = new GenBuildTask();\r
+                genBuildTask.setSingleModuleBuild(true);\r
+                genBuildTask.setType(type);\r
+                getProject().setProperty("PLATFORM_FILE", activePlatform);\r
+                if( !multithread) {\r
+                    originalProperties.put("PLATFORM_FILE", activePlatform);\r
+                }\r
+                genBuildTask.setProject(getProject());\r
+                genBuildTask.setMsaFile(moduleFiles[i]);\r
+                genBuildTask.perform();\r
             }\r
             }\r
-            genBuildTask.setProject(getProject());\r
-            genBuildTask.setMsaFile(buildFile);\r
-            genBuildTask.perform();\r
         }\r
     }\r
     \r
         }\r
     }\r
     \r
index 389b8f12b1006d3751c74da1d7b0177f6d855097..249ca8328dc84730a18a06fd70b0d5e32ffd5a74 100644 (file)
@@ -253,6 +253,10 @@ public class GenBuildTask extends Ant {
             }\r
         }\r
 \r
             }\r
         }\r
 \r
+        if (archList.length == 0) {\r
+            EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " was not found in current platform FPD file!\n");\r
+        }\r
+\r
         for (int k = 0; k < archList.length; k++) {\r
 \r
             getProject().setProperty("ARCH", archList[k]);\r
         for (int k = 0; k < archList.length; k++) {\r
 \r
             getProject().setProperty("ARCH", archList[k]);\r
@@ -422,7 +426,7 @@ public class GenBuildTask extends Ant {
         getProject().setProperty("VERSION", moduleId.getVersion());\r
         getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());\r
         getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));\r
         getProject().setProperty("VERSION", moduleId.getVersion());\r
         getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());\r
         getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));\r
-        getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));\r
+        getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/") + File.separatorChar + moduleId.getName());\r
 \r
         //\r
         // SUBSYSTEM\r
 \r
         //\r
         // SUBSYSTEM\r