import org.apache.tools.ant.taskdefs.Property;\r
import org.apache.xmlbeans.XmlObject;\r
\r
-import org.tianocore.build.exception.EdkException;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.global.OutputManager;\r
import org.tianocore.build.global.SurfaceAreaQuery;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PlatformIdentification;\r
+import org.tianocore.build.pcd.action.ActionMessage;\r
+import org.tianocore.build.pcd.action.CollectPCDAction;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
+import org.tianocore.exception.EdkException;\r
\r
/**\r
<code>FpdParserTask</code> is an ANT task. The main function is parsing Framework\r
if (platformName == null) {\r
throw new BuildException("FpdParserTask parameter error. Please specify platform name or FPD file. ");\r
}\r
- platformId = GlobalData.getPlatform(platformName);\r
+ platformId = GlobalData.getPlatformByName(platformName);\r
fpdFile = platformId.getFpdFile();\r
}\r
\r
//\r
// Ant call ${PLATFORM}_build.xml\r
//\r
+ \r
Ant ant = new Ant();\r
ant.setProject(getProject());\r
ant.setAntfile(platformId.getFpdFile().getParent() + File.separatorChar + platformId.getName() + "_build.xml");\r
bw.close();\r
fw.close();\r
} catch (Exception e) {\r
- e.printStackTrace();\r
throw new BuildException("Generate FV file [" + fvFile.getPath() + "] failed. \n" + e.getMessage());\r
}\r
}\r
Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
map.put("PlatformSurfaceArea", doc);\r
SurfaceAreaQuery.setDoc(map);\r
- \r
+\r
//\r
// Initialize\r
//\r
platformId = SurfaceAreaQuery.getFpdHeader();\r
platformId.setFpdFile(fpdFile);\r
getProject().setProperty("PLATFORM", platformId.getName());\r
+ getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));\r
getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));\r
\r
parseToolChainOptions();\r
\r
SurfaceAreaQuery.setDoc(map);\r
+ \r
+ //\r
+ // Pcd Collection. Call CollectPCDAction to collect pcd info.\r
+ //\r
+ try {\r
+ CollectPCDAction ca = new CollectPCDAction();\r
+ ca.perform(GlobalData.getWorkspacePath(),platformId.getFpdFile().getPath(),ActionMessage.NULL_MESSAGE_LEVEL);\r
+ } catch (Exception e){\r
+ throw new BuildException(e.getMessage());\r
+ }\r
} catch (Exception e) {\r
- e.printStackTrace();\r
throw new BuildException("Load FPD file [" + fpdFile.getPath() + "] error. \n" + e.getMessage());\r
}\r
}\r
**/\r
private void parseModuleSAFiles() throws EdkException{\r
Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();\r
- System.out.println("Nubmer: ##" + moduleSAs.size());\r
+\r
//\r
// For every Module lists in FPD file.\r
//\r