import java.util.Map;\r
import java.util.Set;\r
import java.util.Vector;\r
-import java.util.TreeMap;\r
\r
import org.apache.tools.ant.BuildException;\r
import org.apache.tools.ant.Task;\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.pcd.exception.EntityException;\r
+import org.tianocore.pcd.action.ActionMessage;\r
+import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;\r
import org.tianocore.build.toolchain.ToolChainAttribute;\r
import org.tianocore.build.toolchain.ToolChainElement;\r
import org.tianocore.build.toolchain.ToolChainMap;\r
///\r
private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();\r
\r
- ///\r
- /// Mapping from sequence number to FV names\r
- ///\r
- private Map<String, Set<String>> sequences = new TreeMap<String, Set<String>>();\r
-\r
///\r
/// FpdParserTask can specify some ANT properties. \r
///\r
//\r
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());\r
\r
- //\r
- // Generate FDF (Flash Definition File) file\r
- //\r
-\r
//\r
// For every Target and ToolChain\r
//\r
//\r
// Gen build.xml\r
//\r
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, sequences, isUnified);\r
+ PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);\r
fileGenerator.genBuildFile();\r
\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
- SurfaceAreaQuery.getFpdUserExtension();\r
+\r
//\r
// Initialize\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
+ PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();\r
+ ca.perform(platformId.getFpdFile().getPath(), ActionMessage.NULL_MESSAGE_LEVEL);\r
} catch (Exception e) {\r
- e.printStackTrace();\r
throw new BuildException("Load FPD file [" + fpdFile.getPath() + "] error. \n" + e.getMessage());\r
}\r
}\r
SurfaceAreaQuery.pop();\r
\r
fpdModuleId.setFvBinding(fvBinding);\r
- String fvSequence = fpdModuleId.getSequence();\r
- updateFvs(fvSequence, fvBinding, fpdModuleId);\r
+ updateFvs(fvBinding, fpdModuleId);\r
\r
//\r
// Prepare for out put file name\r
@param fvName current FV name\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
+ private void updateFvs(String fvName, FpdModuleIdentification fpdModuleId) {\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
set.add(fpdModuleId);\r
fvs.put(fvNameArray[i], set);\r
}\r
- \r
- //\r
- // Put fvName to corresponding fvSequence\r
- //\r
- if (sequences.containsKey(fvSequence)) {\r
- Set<String> set = sequences.get(fvSequence);\r
- set.add(fvNameArray[i]);\r
- }\r
- else {\r
- Set<String> set = new LinkedHashSet<String>();\r
- set.add(fvNameArray[i]);\r
- sequences.put(fvSequence, set);\r
- }\r
}\r
}\r
\r