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.pcd.action.ActionMessage;\r
import org.tianocore.build.pcd.action.CollectPCDAction;\r
-import org.tianocore.build.pcd.exception.EntityException;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainMap;\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
parseFpdFile();\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
- \r
//\r
// Prepare BUILD_DIR\r
//\r
getProject().setProperty(globalVariables[j][0], globalVariables[j][1]);\r
}\r
\r
- getProject().setProperty("FV_FILENAME", validFv[i].toUpperCase());\r
+ getProject().setProperty("FV_FILENAME", validFv[i]);\r
\r
- File fvFile = new File(getProject().replaceProperties( getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i].toUpperCase() + ".inf"));\r
+ File fvFile = new File(getProject().replaceProperties( getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".inf"));\r
fvFile.getParentFile().mkdirs();\r
\r
try {\r
//\r
// Files\r
//\r
- Set<FpdModuleIdentification> filesSet = fvs.get(validFv[i].toUpperCase());\r
+ Set<FpdModuleIdentification> filesSet = fvs.get(validFv[i]);\r
if (filesSet != null) {\r
FpdModuleIdentification[] files = filesSet.toArray(new FpdModuleIdentification[filesSet.size()]);\r
bw.write("[files]");\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
@param moduleName current module identification\r
**/\r
private void updateFvs(String fvSequence, String fvName, FpdModuleIdentification fpdModuleId) {\r
- String upcaseFvName = fvName.toUpperCase();\r
- String[] fvNameArray = upcaseFvName.split("[, \t]+");\r
+ if (fvName == null || fvName.trim().length() == 0) {\r
+ fvName = "NULL";\r
+ }\r
+ String[] fvNameArray = fvName.split("[, \t]+");\r
for (int i = 0; i < fvNameArray.length; i++) {\r
//\r
// Put module to corresponding fvName\r