summaryrefslogtreecommitdiff
path: root/Tools/Source/GenBuild/org/tianocore/build/fpd
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-03 02:55:45 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-03 02:55:45 +0000
commit01413f0ccb4e678f633c42d300a1eced780a22d5 (patch)
treecc29ddc7b9018cee9d00b8c9099221d7ac35077b /Tools/Source/GenBuild/org/tianocore/build/fpd
parent802e005517d1c21865c5d50c0933abc8289ea5de (diff)
downloadedk2-01413f0ccb4e678f633c42d300a1eced780a22d5.zip
edk2-01413f0ccb4e678f633c42d300a1eced780a22d5.tar.gz
edk2-01413f0ccb4e678f633c42d300a1eced780a22d5.tar.bz2
Remove some unused code and adjust some code format. Modules build with FPD sequence. Delete three unused Java files.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1179 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/GenBuild/org/tianocore/build/fpd')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java30
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java179
2 files changed, 69 insertions, 140 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
index ea28781..37e05fd 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
@@ -25,7 +25,6 @@ import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
-import java.util.TreeMap;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
@@ -99,11 +98,6 @@ public class FpdParserTask extends Task {
private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();
///
- /// Mapping from sequence number to FV names
- ///
- private Map<String, Set<String>> sequences = new TreeMap<String, Set<String>>();
-
- ///
/// FpdParserTask can specify some ANT properties.
///
private Vector<Property> properties = new Vector<Property>();
@@ -153,10 +147,6 @@ public class FpdParserTask extends Task {
isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
//
- // Generate FDF (Flash Definition File) file
- //
-
- //
// For every Target and ToolChain
//
String[] targetList = GlobalData.getToolChainInfo().getTargets();
@@ -183,7 +173,7 @@ public class FpdParserTask extends Task {
//
// Gen build.xml
//
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, sequences, isUnified);
+ PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, isUnified);
fileGenerator.genBuildFile();
//
@@ -426,8 +416,7 @@ public class FpdParserTask extends Task {
SurfaceAreaQuery.pop();
fpdModuleId.setFvBinding(fvBinding);
- String fvSequence = fpdModuleId.getSequence();
- updateFvs(fvSequence, fvBinding, fpdModuleId);
+ updateFvs(fvBinding, fpdModuleId);
//
// Prepare for out put file name
@@ -499,7 +488,7 @@ public class FpdParserTask extends Task {
@param fvName current FV name
@param moduleName current module identification
**/
- private void updateFvs(String fvSequence, String fvName, FpdModuleIdentification fpdModuleId) {
+ private void updateFvs(String fvName, FpdModuleIdentification fpdModuleId) {
if (fvName == null || fvName.trim().length() == 0) {
fvName = "NULL";
}
@@ -517,19 +506,6 @@ public class FpdParserTask extends Task {
set.add(fpdModuleId);
fvs.put(fvNameArray[i], set);
}
-
- //
- // Put fvName to corresponding fvSequence
- //
- if (sequences.containsKey(fvSequence)) {
- Set<String> set = sequences.get(fvSequence);
- set.add(fvNameArray[i]);
- }
- else {
- Set<String> set = new LinkedHashSet<String>();
- set.add(fvNameArray[i]);
- sequences.put(fvSequence, set);
- }
}
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java
index a5f88f9..b7d2881 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java
@@ -48,16 +48,6 @@ public class PlatformBuildFileGenerator {
///
private Map<FpdModuleIdentification, String> outfiles;
- ///
- /// Mapping from FV name to its modules
- ///
- private Map<String, Set<FpdModuleIdentification>> fvs;
-
- ///
- /// Mapping from sequence number to FV names
- ///
- private Map<String, Set<String>> sequences;
-
private boolean isUnified = true;
private Project project;
@@ -68,11 +58,9 @@ public class PlatformBuildFileGenerator {
+ "Abstract:\n"
+ "Auto-generated ANT build file for building of EFI Modules/Platforms\n";
- public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, Map<String, Set<String>> sequences, boolean isUnified){
+ public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, boolean isUnified){
this.project = project;
this.outfiles = outfiles;
- this.fvs = fvs;
- this.sequences = sequences;
this.isUnified = isUnified;
this.platformName = project.getProperty("PLATFORM");
}
@@ -117,35 +105,21 @@ public class PlatformBuildFileGenerator {
ele.setAttribute("environment", "env");
root.appendChild(ele);
- Set<String> sequenceKeys = sequences.keySet();
- Iterator sequenceIter = sequenceKeys.iterator();
- String dependsStr = "prebuild";
- while (sequenceIter.hasNext()) {
- String num = (String)sequenceIter.next();
- if (dependsStr.length() > 0) {
- dependsStr += " , ";
- }
- dependsStr += "modules" + num + ", fvs" + num;
- }
-
//
// Default Target
//
root.appendChild(document.createComment("Default target"));
ele = document.createElement("target");
ele.setAttribute("name", "all");
- ele.setAttribute("depends", dependsStr + ", postbuild");
+ ele.setAttribute("depends", "prebuild, modules, fvs, postbuild");
root.appendChild(ele);
//
// Modules and Fvs Target
//
- sequenceIter = sequenceKeys.iterator();
- while (sequenceIter.hasNext()) {
- String num = (String)sequenceIter.next();
- applyModules(document, root, num);
- applyFvs(document, root, num);
- }
+ applyModules(document, root);
+
+ applyFvs(document, root);
//
// Clean Target
@@ -194,82 +168,75 @@ public class PlatformBuildFileGenerator {
}
}
- private void applyModules(Document document, Node root, String num) {
+ private void applyModules(Document document, Node root) {
root.appendChild(document.createComment("Modules target"));
Element ele = document.createElement("target");
- ele.setAttribute("name", "modules" + num);
-
- Set<String> fvNameSet = sequences.get(num);
+ ele.setAttribute("name", "modules");
- Iterator fvNameIter = fvNameSet.iterator();
- while (fvNameIter.hasNext()) {
- String fvName = (String)fvNameIter.next();
- Set<FpdModuleIdentification> set = fvs.get(fvName);
- Iterator iter = set.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
- ModuleIdentification moduleId = fpdModuleId.getModule();
- Element moduleEle = document.createElement("GenBuild");
- moduleEle.setAttribute("type", "build");
- //
- // Inherit Properties.
- //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}
- //
-
- //
- // ARCH
- //
- Element property = document.createElement("property");
- property.setAttribute("name", "ARCH");
- property.setAttribute("value", fpdModuleId.getArch());
- moduleEle.appendChild(property);
+ Set<FpdModuleIdentification> set = outfiles.keySet();
+ Iterator iter = set.iterator();
+ while (iter.hasNext()) {
+ FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
+ ModuleIdentification moduleId = fpdModuleId.getModule();
+ Element moduleEle = document.createElement("GenBuild");
+ moduleEle.setAttribute("type", "build");
+ //
+ // Inherit Properties.
+ //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}
+ //
+
+ //
+ // ARCH
+ //
+ Element property = document.createElement("property");
+ property.setAttribute("name", "ARCH");
+ property.setAttribute("value", fpdModuleId.getArch());
+ moduleEle.appendChild(property);
- //
- // MODULE_GUID
- //
- property = document.createElement("property");
- property.setAttribute("name", "MODULE_GUID");
- property.setAttribute("value", moduleId.getGuid());
- moduleEle.appendChild(property);
-
- //
- // MODULE_VERSION
- //
- property = document.createElement("property");
- property.setAttribute("name", "MODULE_VERSION");
- property.setAttribute("value", moduleId.getVersion());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_GUID
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_GUID");
- property.setAttribute("value", moduleId.getPackage().getGuid());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_VERSION
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_VERSION");
- property.setAttribute("value", moduleId.getPackage().getVersion());
- moduleEle.appendChild(property);
-
- ele.appendChild(moduleEle);
- }
+ //
+ // MODULE_GUID
+ //
+ property = document.createElement("property");
+ property.setAttribute("name", "MODULE_GUID");
+ property.setAttribute("value", moduleId.getGuid());
+ moduleEle.appendChild(property);
+
+ //
+ // MODULE_VERSION
+ //
+ property = document.createElement("property");
+ property.setAttribute("name", "MODULE_VERSION");
+ property.setAttribute("value", moduleId.getVersion());
+ moduleEle.appendChild(property);
+
+ //
+ // PACKAGE_GUID
+ //
+ property = document.createElement("property");
+ property.setAttribute("name", "PACKAGE_GUID");
+ property.setAttribute("value", moduleId.getPackage().getGuid());
+ moduleEle.appendChild(property);
+
+ //
+ // PACKAGE_VERSION
+ //
+ property = document.createElement("property");
+ property.setAttribute("name", "PACKAGE_VERSION");
+ property.setAttribute("value", moduleId.getPackage().getVersion());
+ moduleEle.appendChild(property);
+
+ ele.appendChild(moduleEle);
}
root.appendChild(ele);
}
- private void applyFvs(Document document, Node root, String num) {
- Set<String> fvNameSet = sequences.get(num);
+ private void applyFvs(Document document, Node root) {
//
// FVS Target
//
root.appendChild(document.createComment("FVs target"));
Element ele = document.createElement("target");
- ele.setAttribute("name", "fvs" + num);
+ ele.setAttribute("name", "fvs");
//
// For every Target and ToolChain
@@ -283,13 +250,11 @@ public class PlatformBuildFileGenerator {
+ toolchainList[j] + File.separatorChar + "FV";
String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();
for (int k = 0; k < validFv.length; k++) {
- if (fvNameSet.contains(validFv[k]) || ! isListInSequence(validFv[k])) {
- String inputFile = fvOutputDir + "" + File.separatorChar + validFv[k].toUpperCase() + ".inf";
- Element fvEle = document.createElement("genfvimage");
- fvEle.setAttribute("infFile", inputFile);
- fvEle.setAttribute("outputDir", fvOutputDir);
- ele.appendChild(fvEle);
- }
+ String inputFile = fvOutputDir + "" + File.separatorChar + validFv[k].toUpperCase() + ".inf";
+ Element fvEle = document.createElement("genfvimage");
+ fvEle.setAttribute("infFile", inputFile);
+ fvEle.setAttribute("outputDir", fvOutputDir);
+ ele.appendChild(fvEle);
}
}
}
@@ -576,16 +541,4 @@ public class PlatformBuildFileGenerator {
}
return root;
}
-
- private boolean isListInSequence(String fvName) {
- Set<String> numbers = sequences.keySet();
- Iterator<String> iter = numbers.iterator();
- while (iter.hasNext()) {
- Set<String> fvNameSet = sequences.get(iter.next());
- if (fvNameSet.contains(fvName)) {
- return true;
- }
- }
- return false;
- }
}