import org.apache.tools.ant.taskdefs.Property;\r
import org.apache.xmlbeans.XmlObject;\r
\r
+import org.tianocore.common.definitions.EdkDefinitions;\r
import org.tianocore.common.exception.EdkException;\r
import org.tianocore.pcd.action.ActionMessage;\r
import org.tianocore.build.global.GlobalData;\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
+ build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage). </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
<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
public class FpdParserTask extends Task {\r
\r
private PlatformIdentification platformId;\r
\r
- ///\r
- ///\r
- ///\r
private String type;\r
\r
///\r
\r
private boolean isUnified = true;\r
\r
-\r
/**\r
Public construct method. It is necessary for ANT task.\r
**/\r
Surface area is not valid.\r
**/\r
public void execute() throws BuildException {\r
- // Remove !!\r
+ //\r
+ // If fpdFile is not specified, \r
+ // then try to get FPD file by platformName\r
+ //\r
if ( fpdFile == null) {\r
if (platformName == null) {\r
throw new BuildException("FpdParserTask parameter error. Please specify either the platform name or FPD file!");\r
// For every Target and ToolChain\r
//\r
String[] targetList = GlobalData.getToolChainInfo().getTargets();\r
- for (int i = 0; i < targetList.length; i++){\r
+ for (int i = 0; i < targetList.length; i++) {\r
String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();\r
- for(int j = 0; j < toolchainList.length; j++){\r
+ for(int j = 0; j < toolchainList.length; j++) {\r
//\r
// Prepare FV_DIR\r
//\r
//\r
// Gen build.xml\r
//\r
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);\r
+ PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified);\r
fileGenerator.genBuildFile();\r
\r
//\r
ant.setInheritAll(true);\r
ant.init();\r
ant.execute();\r
-\r
-// GlobalData.log.info("Fpd build end. ");\r
}\r
\r
/**\r
//\r
SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
String fvBinding = SurfaceAreaQuery.getModuleFvBindingKeyword();\r
- SurfaceAreaQuery.pop();\r
\r
fpdModuleId.setFvBinding(fvBinding);\r
updateFvs(fvBinding, fpdModuleId);\r
// Prepare for out put file name\r
//\r
ModuleIdentification moduleId = fpdModuleId.getModule();\r
- SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
+\r
String baseName = SurfaceAreaQuery.getModuleOutputFileBasename();\r
- SurfaceAreaQuery.pop();\r
+ \r
if (baseName == null) {\r
baseName = moduleId.getName();\r
}\r
//\r
// parse module build options, if any\r
//\r
- SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));\r
GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));\r
SurfaceAreaQuery.pop();\r
if (fvs.containsKey(fvNameArray[i])) {\r
Set<FpdModuleIdentification> set = fvs.get(fvNameArray[i]);\r
set.add(fpdModuleId);\r
- }\r
- else {\r
+ } else {\r
Set<FpdModuleIdentification> set = new LinkedHashSet<FpdModuleIdentification>();\r
set.add(fpdModuleId);\r
fvs.put(fvNameArray[i], set);\r
throw new BuildException("Module type is not specified.");\r
}\r
\r
- String[][] suffix = { { "BASE", ".FFS"},\r
- { "SEC", ".SEC" }, { "PEI_CORE", ".PEI" },\r
- { "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" },\r
- { "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" },\r
- { "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" },\r
- { "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" },\r
- { "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } };\r
+ String[][] suffix = EdkDefinitions.ModuleTypeExtensions;\r
\r
for (int i = 0; i < suffix.length; i++) {\r
if (suffix[i][0].equalsIgnoreCase(moduleType)) {\r
public void setType(String type) {\r
this.type = type;\r
}\r
-\r
-\r
}\r