summaryrefslogtreecommitdiff
path: root/Tools/Source/GenBuild/org
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
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')
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java55
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/OutputDirSetup.java270
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java30
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java179
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java60
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/Identification.java38
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java52
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java44
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java45
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java63
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/tools/DefaultBuildFileGenerator.java313
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java66
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/tools/PackageItem.java35
13 files changed, 376 insertions, 874 deletions
diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
index 04ebc5c..72870e0 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
@@ -16,7 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
package org.tianocore.build;
import java.io.File;
-import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedHashSet;
@@ -719,60 +718,6 @@ public class GenBuildTask extends Ant {
return result;
}
- /**
- Generate the flags string with original format. The format is defined by
- Java Regulation Expression "[^\\\\]?(\".*?[^\\\\]\")[ \t,]+". </p>
-
- <p>For example: </p>
-
- <pre>
- "/nologo", "/W3", "/WX"
- "/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""
- </pre>
-
- @param add the add flags set
- @param sub the sub flags set
- @return flags with original format
- **/
- private String getRawFlags(Set<String> add, Set<String> sub) {
- String result = null;
- add.removeAll(sub);
- Iterator iter = add.iterator();
- while (iter.hasNext()) {
- String str = (String) iter.next();
- result += "\"" + str.substring(1, str.length() - 1) + "\", ";
- }
- return result;
- }
-
- private String parseOptionString(String optionString, Set<String> addSet, Set<String> subSet) {
- boolean overrideOption = false;
- Pattern pattern = Pattern.compile("ADD\\.\\[(.+)\\]");
- Matcher matcher = pattern.matcher(optionString);
-
- while (matcher.find()) {
- overrideOption = true;
- String addOption = optionString.substring(matcher.start(1), matcher.end(1)).trim();
- putFlagsToSet(addSet, addOption);
-
- }
-
- pattern = Pattern.compile("SUB\\.\\[(.+)\\]");
- matcher = pattern.matcher(optionString);
-
- while (matcher.find()) {
- overrideOption = true;
- String subOption = optionString.substring(matcher.start(1), matcher.end(1)).trim();
- putFlagsToSet(subSet, subOption);
- }
-
- if (overrideOption == true) {
- return null;
- }
-
- return optionString;
- }
-
private void pushProperties() {
backupPropertiesStack.push(getProject().getProperties());
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/OutputDirSetup.java b/Tools/Source/GenBuild/org/tianocore/build/OutputDirSetup.java
deleted file mode 100644
index fc24f6f..0000000
--- a/Tools/Source/GenBuild/org/tianocore/build/OutputDirSetup.java
+++ /dev/null
@@ -1,270 +0,0 @@
-package org.tianocore.build;
-
-import java.io.File;
-import java.util.Map;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.build.fpd.FpdParserTask;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.build.id.PlatformIdentification;
-
-public class OutputDirSetup extends Task {
- ///
- /// Module surface area file.
- ///
- File msaFile;
-
- ///
- /// Module's Identification.
- ///
- private ModuleIdentification moduleId;
-
- ///
- /// Module's component type, such as SEC, LIBRARY, BS_DRIVER and so on.
- ///
- private String componentType;
-
- private boolean isSingleModuleBuild = false;
-// private ToolChainFactory toolChainFactory;
-
- /**
- Public construct method. It is necessary for ANT task.
- **/
- public OutputDirSetup() {
- }
-
- public void execute() throws BuildException {
- //
- // Global Data initialization
- //
-// GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",
-// getProject().getProperty("WORKSPACE_DIR"));
-
- //
- // Parse MSA and get the basic information
- // Including BaseName, GUID, Version, ComponentType and SupportedArchs
- //
- Map<String, XmlObject> doc = GlobalData.getNativeMsa(msaFile);
-
- SurfaceAreaQuery.setDoc(doc);
-
- //
- // String[]: {BaseName, ModuleType, ComponentType, Guid, Version}
- //
- moduleId = SurfaceAreaQuery.getMsaHeader();
- // REMOVE!!! TBD
- componentType = "APPLICATION";
-
- //
- // Judge whether it is single module build or not
- //
- if (isSingleModuleBuild) {
- //
- // Single Module build
- //
- prepareSingleModuleBuild();
- }
- else {
- //
- // Platform build
- //
- String filename = getProject().getProperty("PLATFORM_FILE");
- PlatformIdentification platformId = GlobalData.getPlatform(filename);
- getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
- getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
-
- String packageName = getProject().getProperty("PACKAGE");
- String packageGuid = getProject().getProperty("PACKAGE_GUID");
- String packageVersion = getProject().getProperty("PACKAGE_VERSION");
- PackageIdentification packageId = new PackageIdentification(packageName, packageGuid, packageVersion);
- moduleId.setPackage(packageId);
- }
-
- //
- // Tools Definition file parse
- //
- parseToolsDefinitionFile();
-
- //
- // For Every TOOLCHAIN, TARGET, ARCH
- //
-// String[] targetList = GlobalData.getTargets();
-// for (int i = 0; i < targetList.length; i ++){
-// //
-// // Prepare for target related common properties
-// // TARGET
-// //
-// getProject().setProperty("TARGET", targetList[i]);
-// String[] toolchainList = GlobalData.getToolChains();
-// for(int j = 0; j < toolchainList.length; j ++){
-// //
-// // Prepare for toolchain related common properties
-// // TOOLCHAIN
-// //
-// getProject().setProperty("TOOLCHAIN", toolchainList[j]);
-// //
-// // If single module : intersection MSA supported ARCHs and tools def!!
-// // else, get arch from pass down
-// //
-// String[] archList = GlobalData.getArchs();
-// for (int k = 0; k < archList.length; k++) {
-//
-// FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);
-//
-// SurfaceAreaQuery.setDoc(GlobalData.getDoc(fpdModuleId));
-//
-// //
-// // Prepare for all other common properties
-// // PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
-// // MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, COMPONENT_TYPE
-// // MODULE_DIR, MODULE_RELATIVE_DIR
-// // SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH
-// // LIBS, OBJECTS, SDB_FILES
-// //
-// getProject().setProperty("ARCH", archList[k]);
-// setModuleCommonProperties();
-//
-// //
-// // String[0] is build mode. String[1] is user-defined output dir.
-// //
-// String buildMode = SurfaceAreaQuery.getFpdIntermediateDirectories();
-// String userDefinedOutputDir = SurfaceAreaQuery.getFpdOutputDirectory();
-//
-// //
-// // OutputManage prepare for
-// // BIN_DIR, DEST_DIR_DEBUG, DEST_DIR_OUTPUT, BUILD_DIR, FV_DIR
-// //
-// OutputManager.getInstance().update(getProject(), userDefinedOutputDir, buildMode);
-//
-// }
-// }
-// }
-
- }
-
- private void prepareSingleModuleBuild(){
- //
- // Find out the package which the module belongs to
- // TBD: Enhance it!!!!
- //
- PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);
-
- moduleId.setPackage(packageId);
-
- //
- // Read ACTIVE_PLATFORM's FPD file (Call FpdParserTask's method)
- //
- String filename = getProject().getProperty("PLATFORM_FILE");
-
- PlatformIdentification platformId = GlobalData.getPlatform(filename);
-
- //
- // Read FPD file
- //
- FpdParserTask fpdParser = new FpdParserTask();
- fpdParser.parseFpdFile(platformId.getFpdFile());
-
- //
- // Prepare for Platform related common properties
- // PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR
- //
- getProject().setProperty("PLATFORM", platformId.getName());
- getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
- getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
- }
-
-
-
- /**
-
- **/
- private void setModuleCommonProperties() {
- //
- // Prepare for all other common properties
- // PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
- //
- PackageIdentification packageId = moduleId.getPackage();
- getProject().setProperty("PACKAGE", packageId.getName());
- getProject().setProperty("PACKAGE_GUID", packageId.getGuid());
- getProject().setProperty("PACKAGE_VERSION", packageId.getVersion());
- GlobalData.log.info("" + packageId);
- getProject().setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));
- getProject().setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));
-
- //
- // MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, COMPONENT_TYPE
- // MODULE_DIR, MODULE_RELATIVE_DIR
- //
- getProject().setProperty("MODULE", moduleId.getName());
- getProject().setProperty("BASE_NAME", moduleId.getName());
- getProject().setProperty("GUID", moduleId.getGuid());
- getProject().setProperty("FILE_GUID", moduleId.getGuid());
- getProject().setProperty("VERSION", moduleId.getVersion());
- getProject().setProperty("COMPONENT_TYPE", componentType);
- getProject().setProperty("MODULE_DIR", moduleId.getMsaFile().getParent().replaceAll("(\\\\)", "/"));
- getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/"));
- }
-
-
- /**
- Method is for ANT use to initialize MSA file.
-
- @param msaFilename MSA file name
- **/
- public void setMsaFile(String msaFilename) {
- String moduleDir = getProject().getProperty("MODULE_DIR");
- if (moduleDir == null) {
- moduleDir = getProject().getBaseDir().getPath();
- }
- msaFile = new File(moduleDir + File.separatorChar + msaFilename);
- }
-
- /**
- Compile flags setup.
-
- <p> Take command <code>CC</code> and arch <code>IA32</code> for example,
- Those flags are from <code>ToolChainFactory</code>: </p>
- <ul>
- <li> IA32_CC </li>
- <li> IA32_CC_STD_FLAGS </li>
- <li> IA32_CC_GLOBAL_FLAGS </li>
- <li> IA32_CC_GLOBAL_ADD_FLAGS </li>
- <li> IA32_CC_GLOBAL_SUB_FLAGS </li>
- </ul>
- Those flags can user-define:
- <ul>
- <li> IA32_CC_PROJ_FLAGS </li>
- <li> IA32_CC_PROJ_ADD_FLAGS </li>
- <li> IA32_CC_PROJ_SUB_FLAGS </li>
- <li> CC_PROJ_FLAGS </li>
- <li> CC_PROJ_ADD_FLAGS </li>
- <li> CC_PROJ_SUB_FLAGS </li>
- <li> CC_FLAGS </li>
- <li> IA32_CC_FLAGS </li>
- </ul>
-
- <p> The final flags is composed of STD, GLOBAL and PROJ. If CC_FLAGS or
- IA32_CC_FLAGS is specified, STD, GLOBAL and PROJ will not affect. </p>
-
- Note that the <code>ToolChainFactory</code> executes only once
- during whole build process.
- **/
- private void parseToolsDefinitionFile() {
- //
- // If ToolChain has been set up before, do nothing.
- // CONF dir + tools definition file name
- //
- String confDir = GlobalData.getWorkspacePath() + File.separatorChar + "Tools" + File.separatorChar + "Conf";
- String toolsDefFilename = "tools_def.txt";
- if (getProject().getProperty("env.TOOLS_DEF") != null) {
- toolsDefFilename = getProject().getProperty("env.TOOLS_DEF");
- }
-// toolChainFactory = new ToolChainFactory(confDir, toolsDefFilename);
-// toolChainFactory.setupToolChain();
- }
-}
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;
- }
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java
index add968f..c9bb710 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java
@@ -15,32 +15,38 @@ package org.tianocore.build.id;
/**
- This class is used to identify a module with BaseName, GUID, Version, PackageName
- and ARCH.
+ This class is used to identify a module with Module Guid, Module Version,
+ Package Guid, Package Version and Arch.
@since GenBuild 1.0
- **/
+**/
public class FpdModuleIdentification {
private String arch;
private String fvBinding = "NULL"; // Optional
- private String sequence = "0"; // Optional
-
private ModuleIdentification module;
- private String target; // Optional
-
- private String toolchain; // Optional
-
- public FpdModuleIdentification(String arch, String fvBinding, String sequence, ModuleIdentification module){
+ /**
+ Constructor Method.
+
+ @param arch Build Arch
+ @param fvBinding Belong to what FVs
+ @param module ModuleIdentification
+ **/
+ public FpdModuleIdentification(String arch, String fvBinding, ModuleIdentification module){
this.arch = arch;
this.fvBinding = fvBinding;
- this.sequence = sequence;
this.module = module;
}
+ /**
+ Constructor Method.
+
+ @param arch Build Arch
+ @param module ModuleIdentification
+ **/
public FpdModuleIdentification(ModuleIdentification module, String arch){
this.arch = arch;
this.module = module;
@@ -66,42 +72,58 @@ public class FpdModuleIdentification {
}
}
+ /**
+ @param fvBinding
+ **/
public void setFvBinding(String fvBinding) {
this.fvBinding = fvBinding;
}
- public void setSequence(String sequence) {
- this.sequence = sequence;
- }
-
+ /* (non-Javadoc)
+ @see java.lang.Object#toString()
+ **/
public String toString(){
return arch + ":" + module;
}
+ /**
+ @return String fvBinding
+ **/
public String getFvBinding() {
return fvBinding;
}
- public String getSequence() {
- return sequence;
- }
-
+ /**
+ @return ModuleIdentification module ID
+ **/
public ModuleIdentification getModule() {
return module;
}
+ /**
+ @param module Module Identification
+ **/
public void setModule(ModuleIdentification module) {
this.module = module;
}
+ /**
+ @return String arch
+ **/
public String getArch() {
return arch;
}
+ /**
+ @param arch build ARCH
+ **/
public void setArch(String arch) {
this.arch = arch;
}
+ /* (non-Javadoc)
+ @see java.lang.Object#hashCode()
+ **/
public int hashCode(){
return module.hashCode();
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java b/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
index 8315358..5c77e8e 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/Identification.java
@@ -13,8 +13,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
package org.tianocore.build.id;
-import org.tianocore.build.global.GlobalData;
+/**
+ This class is used to identify with its GUID and Version.
+
+ @since GenBuild 1.0
+**/
public class Identification {
String name;
@@ -23,19 +27,29 @@ public class Identification {
String version;
- String type; // Optional
-
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ **/
Identification(String name, String guid, String version){
this.name = name;
this.guid = guid;
this.version = version;
}
+ /**
+ @param guid Guid
+ @param version Version
+ **/
Identification(String guid, String version){
this.guid = guid;
this.version = version;
}
+ /* (non-Javadoc)
+ @see java.lang.Object#equals(java.lang.Object)
+ **/
public boolean equals(Object obj) {
if (obj instanceof Identification) {
Identification id = (Identification)obj;
@@ -57,14 +71,23 @@ public class Identification {
}
}
+ /**
+ @param name Name
+ **/
public void setName(String name) {
this.name = name;
}
+ /**
+ @param guid Guid
+ **/
public void setGuid(String guid) {
this.guid = guid;
}
+ /**
+ @param version Version
+ **/
public void setVersion(String version) {
this.version = version;
}
@@ -73,14 +96,23 @@ public class Identification {
return guid;
}
+ /**
+ @return String Name
+ **/
public String getName() {
return name;
}
+ /**
+ @return String Version
+ **/
public String getVersion() {
return version;
}
+ /* (non-Javadoc)
+ @see java.lang.Object#hashCode()
+ **/
public int hashCode(){
return guid.toLowerCase().hashCode();
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
index 7f146b6..d7c6f62 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
@@ -16,7 +16,12 @@ package org.tianocore.build.id;
import java.io.File;
import org.tianocore.build.global.GlobalData;
+/**
+ This class is used to identify a module with Module Guid, Module Version,
+ Package Guid, Package Version.
+ @since GenBuild 1.0
+**/
public class ModuleIdentification extends Identification {
private PackageIdentification packageId;
@@ -27,37 +32,69 @@ public class ModuleIdentification extends Identification {
private boolean isLibrary = false;
+ /**
+ @param guid Guid
+ @param version Version
+ **/
public ModuleIdentification(String guid, String version){
super(guid, version);
}
+ /**
+ @param guid Guid
+ @param version Version
+ @param packageId Package Identification
+ **/
public ModuleIdentification(String guid, String version, PackageIdentification packageId){
super(guid, version);
this.packageId = packageId;
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ **/
public ModuleIdentification(String name, String guid, String version){
super(name, guid, version);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ @param packageId PackageIdentification
+ **/
public ModuleIdentification(String name, String guid, String version, PackageIdentification packageId){
super(name, guid, version);
this.packageId = packageId;
}
+ /**
+ @return boolean is this module is library
+ **/
public boolean isLibrary() {
return isLibrary;
}
+ /**
+ @param isLibrary
+ **/
public void setLibrary(boolean isLibrary) {
this.isLibrary = isLibrary;
}
+ /**
+ @return MSA File
+ **/
public File getMsaFile() {
prepareMsaFile();
return msaFile;
}
+ /**
+ @return Module relative path to package
+ **/
public String getModuleRelativePath() {
prepareMsaFile();
if (msaFile.getParent().length() == packageId.getPackageDir().length()) {
@@ -72,6 +109,9 @@ public class ModuleIdentification extends Identification {
}
}
+ /**
+ @param msaFile Set Msa File
+ **/
public void setMsaFile(File msaFile) {
this.msaFile = msaFile;
}
@@ -109,14 +149,23 @@ public class ModuleIdentification extends Identification {
}
}
+ /**
+ @param packageId set package identification
+ **/
public void setPackage(PackageIdentification packageId) {
this.packageId = packageId;
}
+ /**
+ @return get package identification
+ **/
public PackageIdentification getPackage() {
return packageId;
}
+ /**
+ @return get module type
+ **/
public String getModuleType() {
if (moduleType == null) {
GlobalData.refreshModuleIdentification(this);
@@ -124,6 +173,9 @@ public class ModuleIdentification extends Identification {
return moduleType;
}
+ /**
+ @param moduleType set module type
+ **/
public void setModuleType(String moduleType) {
this.moduleType = moduleType;
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
index 815fd44..cb0b2a0 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
@@ -16,35 +16,69 @@ import java.io.File;
import org.tianocore.build.global.GlobalData;
+/**
+ This class is used to identify a package.
+
+ @since GenBuild 1.0
+**/
public class PackageIdentification extends Identification{
//
- // It is optional
+ // SPD file
//
private File spdFile;
+ /**
+ @param guid Guid
+ @param version Version
+ **/
public PackageIdentification(String guid, String version){
super(guid, version);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ **/
public PackageIdentification(String name, String guid, String version){
super(name, guid, version);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ @param spdFilename SPD file name
+ **/
public PackageIdentification(String name, String guid, String version, String spdFilename){
super(name, guid, version);
this.spdFile = new File(spdFilename);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ @param spdFile SPD file
+ **/
public PackageIdentification(String name, String guid, String version, File spdFile){
super(name, guid, version);
this.spdFile = spdFile;
}
+ /**
+ set SPD file.
+ @param spdFile SPD file
+ **/
public void setSpdFile(File spdFile) {
this.spdFile = spdFile;
}
+ /**
+ get SPD file
+ @return SPD file
+ **/
public File getSpdFile() {
return spdFile;
}
@@ -61,11 +95,19 @@ public class PackageIdentification extends Identification{
}
}
+ /**
+ get package directory
+ @return Package Directory
+ **/
public String getPackageDir(){
prepareSpdFile();
return spdFile.getParent();
}
+ /**
+ get package relative directory.
+ @return package relative directory
+ **/
public String getPackageRelativeDir(){
prepareSpdFile();
String relativeDir =spdFile.getParent().substring(GlobalData.getWorkspacePath().length());
diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
index c5c2f1e..7c66965 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
@@ -16,23 +16,52 @@ import java.io.File;
import org.tianocore.build.global.GlobalData;
+/**
+ This class is used to identify a platform.
+
+ @since GenBuild 1.0
+**/
public class PlatformIdentification extends Identification{
+ ///
+ /// FPD file
+ ///
private File fpdFile;
+ /**
+ @param guid Guid
+ @param version Version
+ **/
public PlatformIdentification(String guid, String version){
super(guid, version);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ **/
public PlatformIdentification(String name, String guid, String version){
super(name, guid, version);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ @param fpdFilename Fpd File Name
+ **/
public PlatformIdentification(String name, String guid, String version, String fpdFilename){
super(name, guid, version);
this.fpdFile = new File(fpdFilename);
}
+ /**
+ @param name Name
+ @param guid Guid
+ @param version Version
+ @param fpdFile Fpd File
+ **/
public PlatformIdentification(String name, String guid, String version, File fpdFile){
super(name, guid, version);
this.fpdFile = fpdFile;
@@ -42,14 +71,26 @@ public class PlatformIdentification extends Identification{
return "Platform " + name + "["+guid+"]";
}
+ /**
+ Set FPD file.
+ @param fpdFile FPD File
+ **/
public void setFpdFile(File fpdFile) {
this.fpdFile = fpdFile;
}
+ /**
+ Get FPD file.
+ @return Fpd File
+ **/
public File getFpdFile() {
return fpdFile;
}
+ /**
+ Get FPD relative file to workspace.
+ @return Fpd Relative file.
+ **/
public String getRelativeFpdFile (){
String relativeDir = fpdFile.getPath().substring(GlobalData.getWorkspacePath().length());
if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
@@ -58,6 +99,10 @@ public class PlatformIdentification extends Identification{
return relativeDir;
}
+ /**
+ Get Platform relative directory to workspace.
+ @return Platform relative directory
+ **/
public String getPlatformRelativeDir(){
String relativeDir = fpdFile.getParent().substring(GlobalData.getWorkspacePath().length());
if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java
deleted file mode 100644
index 5af54ba..0000000
--- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file
- ToolChainTask class.
-
- ToolChainTask class's main fucntion is read all tool chain related config files.
-
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-package org.tianocore.build.toolchain;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-/**
- This class is an ANT task. The main function is to read all tool chain related
- config files.
-
- @since GenBuild 1.0
-**/
-public class ToolChainTask extends Task{
- ///
- /// environment variable name of toolchain
- ///
- static private String toolsEnv = "env.TOOLS_DEF";
- ///
- /// configuration file path
- ///
- private String confPath = ".";
-
- /**
- Public construct method. It is necessary for ANT task.
- **/
- public ToolChainTask(){
- }
-
- /**
- ANT task's entry point, will be called after init(). Using
- <code>ToolChainFactory</code> to parse all config files, and
- set TARGET property.
-
- @throws BuildException
- Config files are invalid.
- **/
- public void execute() throws BuildException {
- String toolChain = getProject().getProperty(toolsEnv);
- }
-
- /**
- Set the path of config files.
-
- @param confPath the path of config files
- **/
- public void setConfPath(String confPath) {
- this.confPath = confPath;
- }
-}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/tools/DefaultBuildFileGenerator.java b/Tools/Source/GenBuild/org/tianocore/build/tools/DefaultBuildFileGenerator.java
deleted file mode 100644
index 422d503..0000000
--- a/Tools/Source/GenBuild/org/tianocore/build/tools/DefaultBuildFileGenerator.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/** @file
- This file is an ANT task.
-
- LibBuildFileGenerator task is used to generate module's build.xml file.
-
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-package org.tianocore.build.tools;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class DefaultBuildFileGenerator extends Task {
-
- private Set<ModuleIdentification> modules = new LinkedHashSet<ModuleIdentification>();
-
- private Set<PackageIdentification> packages = new LinkedHashSet<PackageIdentification>();
-
- //
- // <DefaultBuildFileGenerator mode="WORKSPACE | PACKAGE | MODULE">
- // <PackageItem packageName="" packageGuid="" packageVersion="" />
- // <ModuleItem moduleName="HelloWorld" moduleGuid="" moduleVersion="" packageName="" packageGuid="" packageVersion="" />
- // </DefaultBuildFileGenerator>
- //
- private String mode = "MODULE";
-
- private String license = " Copyright (c) 2006, Intel Corporation \n"
- + "All rights reserved. This program and the accompanying materials \n"
- + "are licensed and made available under the terms and conditions of the BSD License \n"
- + "which accompanies this distribution. The full text of the license may be found at \n"
- + "http://opensource.org/licenses/bsd-license.php \n"
- + "\n"
- + "THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN \"AS IS\" BASIS, \n"
- + "WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.";
-
- /**
- Public construct method. It is necessary for ANT task.
- **/
- public DefaultBuildFileGenerator () {
- }
-
- public void execute() throws BuildException {
- //
- // Global Data initialization
- //
- GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",
- getProject().getProperty("WORKSPACE_DIR"), "tools_def.txt");
-
- if (mode.equalsIgnoreCase("WORKSPACE")) {
- modules.clear();
- packages = GlobalData.getPackageList();
- }
- else if (mode.equalsIgnoreCase("PACKAGE")) {
- modules.clear();
- }
- if (mode.equalsIgnoreCase("WORKSPACE") || mode.equalsIgnoreCase("PACKAGE")) {
- Iterator iter = packages.iterator();
- while (iter.hasNext()) {
- PackageIdentification packageId = (PackageIdentification)iter.next();
- modules.addAll(GlobalData.getModules(packageId));
- }
- }
-
- Iterator iter = modules.iterator();
- while (iter.hasNext()) {
- ModuleIdentification moduleId = (ModuleIdentification)iter.next();
- genBuildFile (moduleId);
- }
- }
-
- private void genBuildFile(ModuleIdentification moduleId) {
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- try {
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- Document document = dombuilder.newDocument();
- //
- // create root element and its attributes
- //
- document.appendChild(document.createComment(license));
- Element root = document.createElement("project");
- root.setAttribute("default", "all");
- root.setAttribute("basedir", ".");
- root.setAttribute("name", moduleId.getName());
-
- //
- // element for External ANT tasks
- //
- root.appendChild(document.createComment("Apply external ANT tasks"));
- Element ele = document.createElement("taskdef");
- ele.setAttribute("resource", "GenBuild.tasks");
- root.appendChild(ele);
-
- //
- // <taskdef resource="net/sf/antcontrib/antlib.xml" />
- //
- ele = document.createElement("taskdef");
- ele.setAttribute("resource", "net/sf/antcontrib/antlib.xml");
- root.appendChild(ele);
-
- ele = document.createElement("property");
- ele.setAttribute("environment", "env");
- root.appendChild(ele);
-
- ele = document.createElement("property");
- ele.setAttribute("name", "WORKSPACE_DIR");
- ele.setAttribute("value", "${env.WORKSPACE}");
- root.appendChild(ele);
-
- ele = document.createElement("property");
- ele.setAttribute("name", "MSA_FILENAME");
- ele.setAttribute("value", GlobalData.getMsaFile(moduleId).getName());
- root.appendChild(ele);
-
- ele = document.createElement("property");
- ele.setAttribute("name", "BASE_NAME");
- ele.setAttribute("value", moduleId.getName());
- root.appendChild(ele);
-
- //
- // Don't change it!!
- //
- ele = document.createElement("import");
- ele.setAttribute("file", "${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml");
- root.appendChild(ele);
-
- //
- // <target name="all">
- // <GenBuild msaFile="HelloWorld.msa"/>
- // </target>
- //
- Element targetEle = document.createElement("target");
- targetEle.setAttribute("name", "all");
-
- ele = document.createElement("GenBuild");
- ele.setAttribute("msaFile", "${MSA_FILENAME}");
- targetEle.appendChild(ele);
-
- root.appendChild(targetEle);
-
- //
- // <target name="clean">
- // <OutputDirSetup msaFile="HelloWorld.msa"/>
- // <if>
- // <available file="${DEST_DIR_OUTPUT}/HelloWorld_build.xml"/>
- // <then>
- // <ant antfile="${DEST_DIR_OUTPUT}/HelloWorld_build.xml" target="clean"/>
- // </then>
- // </if>
- // <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
- // </target>
- //
- targetEle = document.createElement("target");
- targetEle.setAttribute("name", "clean");
-
- ele = document.createElement("OutputDirSetup");
- ele.setAttribute("msaFile", "${MSA_FILENAME}");
- targetEle.appendChild(ele);
-
- ele = document.createElement("if");
-
- Element availableEle = document.createElement("available");
- availableEle.setAttribute("file", "${DEST_DIR_OUTPUT}/${BASE_NAME}_build.xml");
- ele.appendChild(availableEle);
-
- Element thenEle = document.createElement("then");
- Element antEle = document.createElement("ant");
- antEle.setAttribute("antfile", "${DEST_DIR_OUTPUT}/${BASE_NAME}_build.xml");
- antEle.setAttribute("target", "clean");
- thenEle.appendChild(antEle);
- ele.appendChild(thenEle);
- targetEle.appendChild(ele);
-
- ele = document.createElement("delete");
- ele.setAttribute("dir", "${DEST_DIR_OUTPUT}");
- ele.setAttribute("excludes", "*.xml");
- targetEle.appendChild(ele);
-
- root.appendChild(targetEle);
-
- //
- // <target name="cleanall">
- // <OutputDirSetup msaFile="HelloWorld.msa"/>
- // <if>
- // <available file="${DEST_DIR_OUTPUT}/HelloWorld_build.xml"/>
- // <then>
- // <ant antfile="${DEST_DIR_OUTPUT}/HelloWorld_build.xml" target="cleanall"/>
- // </then>
- // </if>
- // <delete dir="${DEST_DIR_OUTPUT}"/>
- // <delete dir="${DEST_DIR_DEBUG}"/>
- // <delete>
- // <fileset dir="${BIN_DIR}" includes="**HelloWorld*"/>
- // </delete>
- // </target>
- //
- targetEle = document.createElement("target");
- targetEle.setAttribute("name", "cleanall");
-
- ele = document.createElement("OutputDirSetup");
- ele.setAttribute("msaFile", "${MSA_FILENAME}");
- targetEle.appendChild(ele);
-
- ele = document.createElement("if");
-
- availableEle = document.createElement("available");
- availableEle.setAttribute("file", "${DEST_DIR_OUTPUT}/${BASE_NAME}_build.xml");
- ele.appendChild(availableEle);
-
- thenEle = document.createElement("then");
- antEle = document.createElement("ant");
- antEle.setAttribute("antfile", "${DEST_DIR_OUTPUT}/${BASE_NAME}_build.xml");
- antEle.setAttribute("target", "cleanall");
- thenEle.appendChild(antEle);
- ele.appendChild(thenEle);
- targetEle.appendChild(ele);
-
- ele = document.createElement("delete");
- ele.setAttribute("dir", "${DEST_DIR_OUTPUT}");
- targetEle.appendChild(ele);
-
- ele = document.createElement("delete");
- ele.setAttribute("dir", "${DEST_DIR_DEBUG}");
- targetEle.appendChild(ele);
-
- ele = document.createElement("delete");
-
- Element filesetEle = document.createElement("fileset");
- filesetEle.setAttribute("dir", "${BIN_DIR}");
- filesetEle.setAttribute("includes", "**${BASE_NAME}*");
- ele.appendChild(filesetEle);
-
- targetEle.appendChild(ele);
-
- root.appendChild(targetEle);
-
-
- document.appendChild(root);
-
- //
- // Prepare the DOM document for writing
- //
- Source source = new DOMSource(document);
-
- //
- // Prepare the output file
- //
- String filename = GlobalData.getMsaFile(moduleId).getParent() + File.separatorChar + "build.xml";
- File file = new File(getProject().replaceProperties(filename));
-
- GlobalData.log.info("File generating - " + filename);
- //
- // generate all directory path
- //
- Result result = new StreamResult(file);
-
- //
- // Write the DOM document to the file
- //
- Transformer xformer = TransformerFactory.newInstance()
- .newTransformer();
- xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- xformer.setOutputProperty(OutputKeys.INDENT, "yes");
- xformer.transform(source, result);
- } catch (Exception ex) {
- System.out.println("##" + ex);
- }
-
- }
-
- public void addConfiguredModuleItem(ModuleItem moduleItem) {
- PackageIdentification packageId = new PackageIdentification(moduleItem.getPackageName(), moduleItem.getPackageGuid(), moduleItem.getPackageVersion());
- ModuleIdentification moduleId = new ModuleIdentification(moduleItem.getModuleName(), moduleItem.getModuleGuid(), moduleItem.getModuleVersion());
- moduleId.setPackage(packageId);
- modules.add(moduleId);
- }
-
- public void addConfiguredPackageItem(PackageItem packageItem) {
- PackageIdentification packageId = new PackageIdentification(packageItem.getPackageName(), packageItem.getPackageGuid(), packageItem.getPackageVersion());
- packages.add(packageId);
- }
-
- public void setMode(String mode) {
- this.mode = mode;
- }
-}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java b/Tools/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java
index 8fa8d83..04223cd 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java
@@ -13,20 +13,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
package org.tianocore.build.tools;
import org.apache.tools.ant.BuildException;
-
+/**
+ Ant element for module.
+
+ @since GenBuild 1.0
+**/
public class ModuleItem {
- private String moduleName;
+ private String moduleName = null;
- private String moduleGuid;
+ private String moduleGuid = null;
- private String moduleVersion;
+ private String moduleVersion = null;
- private String packageName;
+ private String packageName = null;
- private String packageGuid;
+ private String packageGuid = null;
- private String packageVersion;
+ private String packageVersion = null;
public ModuleItem(){
@@ -36,50 +40,98 @@ public class ModuleItem {
}
+ /**
+ Get module Guid.
+ @return Module Guid
+ **/
public String getModuleGuid() {
return moduleGuid;
}
+ /**
+ Set module Guid
+ @param moduleGuid Module Guid
+ **/
public void setModuleGuid(String moduleGuid) {
this.moduleGuid = moduleGuid;
}
+ /**
+ Get Module Name.
+ @return Module Name
+ **/
public String getModuleName() {
return moduleName;
}
+ /**
+ Set Module Name.
+ @param moduleName Module Name
+ **/
public void setModuleName(String moduleName) {
this.moduleName = moduleName;
}
+ /**
+ Get Module Version.
+ @return Module Version
+ **/
public String getModuleVersion() {
return moduleVersion;
}
+ /**
+ Set Module Version.
+ @param moduleVersion Module version
+ **/
public void setModuleVersion(String moduleVersion) {
this.moduleVersion = moduleVersion;
}
+ /**
+ Get Package Guid.
+ @return Package Guid
+ **/
public String getPackageGuid() {
return packageGuid;
}
+ /**
+ Set Package Guid.
+ @param packageGuid Package Guid
+ **/
public void setPackageGuid(String packageGuid) {
this.packageGuid = packageGuid;
}
+ /**
+ Get Package Name.
+ @return Package Name
+ **/
public String getPackageName() {
return packageName;
}
+ /**
+ Set Package Name.
+ @param packageName Package Name
+ **/
public void setPackageName(String packageName) {
this.packageName = packageName;
}
+ /**
+ Get Package Version.
+ @return Package Version
+ **/
public String getPackageVersion() {
return packageVersion;
}
+ /**
+ Set Package Version.
+ @param packageVersion Package Version
+ **/
public void setPackageVersion(String packageVersion) {
this.packageVersion = packageVersion;
}
diff --git a/Tools/Source/GenBuild/org/tianocore/build/tools/PackageItem.java b/Tools/Source/GenBuild/org/tianocore/build/tools/PackageItem.java
index abe40b7..f61782d 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/tools/PackageItem.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/tools/PackageItem.java
@@ -14,13 +14,18 @@ package org.tianocore.build.tools;
import org.apache.tools.ant.BuildException;
+/**
+ Ant element for Package.
+
+ @since GenBuild 1.0
+**/
public class PackageItem {
- private String packageName;
+ private String packageName = null;
- private String packageGuid;
+ private String packageGuid = null;
- private String packageVersion;
+ private String packageVersion = null;
public PackageItem(){
@@ -33,26 +38,50 @@ public class PackageItem {
public String toString(){
return "[" + packageName + packageGuid + "]";
}
+ /**
+ Get Package Guid.
+ @return Package Guid
+ **/
public String getPackageGuid() {
return packageGuid;
}
+ /**
+ Set Package Guid.
+ @param packageGuid Package Guid
+ **/
public void setPackageGuid(String packageGuid) {
this.packageGuid = packageGuid;
}
+ /**
+ Get Package Name.
+ @return Package Name
+ **/
public String getPackageName() {
return packageName;
}
+ /**
+ Set Package Name.
+ @param packageName Package Name
+ **/
public void setPackageName(String packageName) {
this.packageName = packageName;
}
+ /**
+ Get Package Version.
+ @return Package Version
+ **/
public String getPackageVersion() {
return packageVersion;
}
+ /**
+ Set Package Version.
+ @param packageVersion Package Version
+ **/
public void setPackageVersion(String packageVersion) {
this.packageVersion = packageVersion;
}