]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java
Move ${PLATFORM}_build.xml from PLATFORM_DIR to BULID_DIR. Now, all output files...
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / fpd / FpdParserForThread.java
index b16530b59f4c9765ea4122c5450ace702e383af5..11e926b251a9e27f7f9c6311dfd6ba7254e07d7b 100644 (file)
@@ -1,9 +1,6 @@
 /** @file\r
  This file is ANT task FpdParserTask. \r
  \r
- FpdParserTask is used to parse FPD (Framework Platform Description) and generate\r
- build.out.xml. It is for Package or Platform build use. \r
\r
  Copyright (c) 2006, Intel Corporation\r
  All rights reserved. This program and the accompanying materials\r
  are licensed and made available under the terms and conditions of the BSD License\r
@@ -35,33 +32,9 @@ import org.tianocore.build.id.ModuleIdentification;
 import org.tianocore.build.FrameworkBuildTask;\r
 import org.tianocore.build.GenBuildThread;\r
 import org.tianocore.common.exception.EdkException;\r
+import org.tianocore.common.logger.EdkLog;\r
 \r
 /**\r
-  <code>FpdParserTask</code> is an ANT task. The main function is parsing Framework\r
-  Platform Descritpion (FPD) XML file and generating its ANT build script for \r
-  corresponding platform.  \r
-\r
-  <p>The task sets global properties PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR\r
-  and BUILD_DIR. </p>\r
-  \r
-  <p>The task generates ${PLATFORM}_build.xml file which will be called by top level\r
-  build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage) \r
-  and flash definition file (File is for Tool FlashMap) if necessary. </p>\r
-  \r
-  <p>FpdParserTask task stores all FPD information to GlobalData. And parse\r
-  tools definition file to set up compiler options for different Target and\r
-  different ToolChainTag. </p>\r
-  \r
-  <p>The method parseFpdFile is also prepared for single module build. </p>\r
-  \r
-  <p>The usage is (take NT32 Platform for example):</p>\r
-\r
-  <pre>\r
-  &lt;FPDParser platformName="Nt32" /&gt;\r
-  </pre>\r
-\r
-  <p>The task will initialize all information through parsing Framework Database, \r
-  SPD, Tool chain configuration files. </p>\r
 \r
   @since GenBuild 1.0\r
 **/\r
@@ -94,19 +67,8 @@ public class FpdParserForThread extends FpdParserTask {
     }\r
 \r
     /**\r
-     ANT task's entry method. The main steps is described as following: \r
      \r
-     <ul>\r
-     <li>Initialize global information (Framework DB, SPD files and all MSA files \r
-     listed in SPD). This step will execute only once in whole build process;</li>\r
-     <li>Parse specified FPD file; </li>\r
-     <li>Generate FV.inf files; </li>\r
-     <li>Generate PlatformName_build.xml file for Flatform build; </li>\r
-     <li>Collect PCD information. </li>\r
-     </ul>\r
-     \r
-     @throws BuildException\r
-     Surface area is not valid. \r
+\r
     **/\r
     public void execute() throws BuildException {\r
         //\r
@@ -118,7 +80,8 @@ public class FpdParserForThread extends FpdParserTask {
         // Prepare BUILD_DIR\r
         //\r
         isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
-\r
+        String buildDir = getProject().getProperty("BUILD_DIR");\r
+        \r
         //\r
         // For every Target and ToolChain\r
         //\r
@@ -129,7 +92,7 @@ public class FpdParserForThread extends FpdParserTask {
                 //\r
                 // Prepare FV_DIR\r
                 //\r
-                String ffsCommonDir = getProject().getProperty("BUILD_DIR") + File.separatorChar\r
+                String ffsCommonDir = buildDir + File.separatorChar\r
                                 + targetList[i] + File.separatorChar\r
                                 + toolchainList[j];\r
                 File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");\r
@@ -146,7 +109,8 @@ public class FpdParserForThread extends FpdParserTask {
         //\r
         // Gen build.xml\r
         //\r
-        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq);\r
+        String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";\r
+        PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile);\r
         fileGenerator.genBuildFile();\r
         \r
         //\r
@@ -174,13 +138,13 @@ public class FpdParserForThread extends FpdParserTask {
         //\r
         Ant ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget("prebuild");\r
         ant.setInheritAll(true);\r
         ant.init();\r
         ant.execute();\r
         \r
-        System.out.println("Task number is " + allThreads.size());\r
+        EdkLog.log(this, "Task number is " + allThreads.size());\r
         \r
         //\r
         // Waiting for all thread over, or time out\r
@@ -228,7 +192,7 @@ public class FpdParserForThread extends FpdParserTask {
                     //\r
                     // Exist ready thread\r
                     //\r
-                    System.out.println("## Exist ready thread");\r
+                    EdkLog.log(this, "## Exist ready thread");\r
 \r
                 } else if (existNoneReady && currentRunNumber == 0) {\r
                     //\r
@@ -239,14 +203,14 @@ public class FpdParserForThread extends FpdParserTask {
                     //\r
                     // Current queue build finish, move to next\r
                     //\r
-                    System.out.println("## Current queue build finish, move to next");\r
+                    EdkLog.log(this, "## Current queue build finish, move to next");\r
                     ++currentQueueCode;\r
                     continue ;\r
                 } else {\r
                     //\r
                     // active thread exist, but no ready thread\r
                     //\r
-                    System.out.println("## active thread exist, but no ready thread" + currentRunNumber);\r
+                    EdkLog.log(this, "## active thread exist, but no ready thread" + currentRunNumber);\r
                 }\r
 \r
                 try {\r
@@ -262,7 +226,7 @@ public class FpdParserForThread extends FpdParserTask {
         //\r
         ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget("fvs");\r
         ant.setInheritAll(true);\r
         ant.init();\r
@@ -270,7 +234,7 @@ public class FpdParserForThread extends FpdParserTask {
         \r
         ant = new Ant();\r
         ant.setProject(getProject());\r
-        ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
+        ant.setAntfile(platformBuildFile);\r
         ant.setTarget("postbuild");\r
         ant.setInheritAll(true);\r
         ant.init();\r