/** @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
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
- <FPDParser platformName="Nt32" />\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
}\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
// 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
//\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
//\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
//\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
//\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
//\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
//\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
\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