Using Common Definitions. Remove some unused codes.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1304 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong 2006-08-17 05:29:15 +00:00
parent 5823a8e9bd
commit 4a6a5026fc
13 changed files with 70 additions and 111 deletions

View File

@ -80,7 +80,7 @@ public class ToolDefinitions {
public final static String TOOLS_DEF_ATTRIBUTE_SPATH = "SPATH"; public final static String TOOLS_DEF_ATTRIBUTE_SPATH = "SPATH";
public final static String TOOLS_DEF_ATTRIBUTE_EXT = "EXT"; public final static String TOOLS_DEF_ATTRIBUTE_EXT = "EXT";
public final static String TOOLS_DEF_ATTRIBUTE_FAMILY = "FAMILY"; public final static String TOOLS_DEF_ATTRIBUTE_FAMILY = "FAMILY";
public final static String TOOLS_DEF_ATTRIBUTE_FLAGS = "FALGS"; public final static String TOOLS_DEF_ATTRIBUTE_FLAGS = "FLAGS";
/// ///
/// Tool Chain Families in the Tools Definition file /// Tool Chain Families in the Tools Definition file

View File

@ -25,6 +25,7 @@ import org.tianocore.BuildOptionsDocument;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
import org.tianocore.build.global.SurfaceAreaQuery; import org.tianocore.build.global.SurfaceAreaQuery;
import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.build.id.FpdModuleIdentification;
import org.tianocore.common.definitions.EdkDefinitions;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -82,19 +83,7 @@ public class FfsProcess {
/// ///
/// mapping from section type to section output file extension /// mapping from section type to section output file extension
/// ///
public static final String[][] sectionExt = { { "EFI_SECTION_FREEFORM_SUBTYPE_GUID", ".sec" }, public static final String[][] sectionExt = EdkDefinitions.SectionTypeExtensions;
{ "EFI_SECTION_VERSION", ".ver" },
{ "EFI_SECTION_USER_INTERFACE", ".ui" },
{ "EFI_SECTION_DXE_DEPEX", ".dpx" },
{ "EFI_SECTION_PEI_DEPEX", ".dpx" },
{ "EFI_SECTION_PE32", ".pe32" },
{ "EFI_SECTION_PIC", ".pic" },
{ "EFI_SECTION_TE", ".tes" },
{ "EFI_SECTION_RAW", ".sec" },
{ "EFI_SECTION_COMPRESSION", ".sec" },
{ "EFI_SECTION_GUID_DEFINED", ".sec" },
{ "EFI_SECTION_COMPATIBILITY16", ".sec" },
{ "EFI_SECTION_FIRMWARE_VOLUME_IMAGE", ".sec" } };
/** /**
search in the type, if componentType is listed in type, return true; search in the type, if componentType is listed in type, return true;

View File

@ -27,6 +27,7 @@ import org.tianocore.build.fpd.FpdParserTask;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
import org.tianocore.build.toolchain.ConfigReader; import org.tianocore.build.toolchain.ConfigReader;
import org.tianocore.build.toolchain.ToolChainInfo; import org.tianocore.build.toolchain.ToolChainInfo;
import org.tianocore.common.definitions.ToolDefinitions;
public class FrameworkBuildTask extends Task{ public class FrameworkBuildTask extends Task{
@ -36,9 +37,11 @@ public class FrameworkBuildTask extends Task{
private Set<File> msaFiles = new LinkedHashSet<File>(); private Set<File> msaFiles = new LinkedHashSet<File>();
String toolsDefFilename = "Tools" + File.separatorChar + "Conf" + File.separatorChar + "tools_def.txt"; String toolsDefFilename = ToolDefinitions.DEFAULT_TOOLS_DEF_FILE_PATH;
String targetFilename = "target.txt"; String targetFilename = ToolDefinitions.TARGET_FILE_PATH;
String dbFilename = ToolDefinitions.FRAMEWORK_DATABASE_FILE_PATH;
String activePlatform = null; String activePlatform = null;
@ -66,12 +69,12 @@ public class FrameworkBuildTask extends Task{
// //
buildFiles.add(files[i]); buildFiles.add(files[i]);
} else if (files[i].getName().endsWith(".fpd")) { } else if (files[i].getName().endsWith(ToolDefinitions.FPD_EXTENSION)) {
// //
// Second, search FPD file, if found, build it // Second, search FPD file, if found, build it
// //
fpdFiles.add(files[i]); fpdFiles.add(files[i]);
} else if (files[i].getName().endsWith(".msa")) { } else if (files[i].getName().endsWith(ToolDefinitions.MSA_EXTENSION)) {
// //
// Third, search MSA file, if found, build it // Third, search MSA file, if found, build it
// //
@ -98,8 +101,7 @@ public class FrameworkBuildTask extends Task{
// //
File workspacePath = new File(getProject().getProperty("WORKSPACE")); File workspacePath = new File(getProject().getProperty("WORKSPACE"));
getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/")); getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/"));
GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db", GlobalData.initInfo(dbFilename, workspacePath.getPath(), toolsDefFilename);
workspacePath.getPath(), toolsDefFilename);
@ -112,38 +114,33 @@ public class FrameworkBuildTask extends Task{
// //
File buildFile = null; File buildFile = null;
if (msaFiles.size() > 1) { if (msaFiles.size() > 1) {
throw new BuildException("More than one MSA file under current directory. It is not allowd. "); throw new BuildException("Having more than one MSA file in a directory is not allowed!");
} } else if (msaFiles.size() == 1 && activePlatform == null) {
else if (msaFiles.size() == 1 && activePlatform == null) { throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. ");
throw new BuildException("If try to build a single module, please set ACTIVE_PLATFORM in file [Tool/Conf/target.txt]. "); } else if (msaFiles.size() == 1 && activePlatform != null) {
}
else if (msaFiles.size() == 1 && activePlatform != null) {
// //
// Build the single module // Build the single module
// //
buildFile = msaFiles.toArray(new File[1])[0]; buildFile = msaFiles.toArray(new File[1])[0];
} } else if (activePlatform != null) {
else if (activePlatform != null) {
buildFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform); buildFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);
} } else if (fpdFiles.size() == 1) {
else if (fpdFiles.size() == 1) {
buildFile = fpdFiles.toArray(new File[1])[0]; buildFile = fpdFiles.toArray(new File[1])[0];
} } else if (fpdFiles.size() > 1) {
else if (fpdFiles.size() > 1) {
buildFile = intercommuniteWithUser(); buildFile = intercommuniteWithUser();
} }
// //
// If there is no build files or FPD files or MSA files, stop build // If there is no build files or FPD files or MSA files, stop build
// //
else { else {
throw new BuildException("Can't find any FPD files or MSA files in current directory. "); throw new BuildException("Can't find any FPD or MSA files in the current directory. ");
} }
// //
// Build every FPD files (PLATFORM build) // Build every FPD files (PLATFORM build)
// //
if (buildFile.getName().endsWith(".fpd")) { if (buildFile.getName().endsWith(ToolDefinitions.FPD_EXTENSION)) {
System.out.println("Start to build FPD file [" + buildFile.getPath() + "] ..>> "); System.out.println("Processing the FPD file [" + buildFile.getPath() + "] ..>> ");
FpdParserTask fpdParserTask = new FpdParserTask(); FpdParserTask fpdParserTask = new FpdParserTask();
fpdParserTask.setType(type); fpdParserTask.setType(type);
fpdParserTask.setProject(getProject()); fpdParserTask.setProject(getProject());
@ -154,10 +151,10 @@ public class FrameworkBuildTask extends Task{
// //
// Build every MSA files (SINGLE MODULE BUILD) // Build every MSA files (SINGLE MODULE BUILD)
// //
else if (buildFile.getName().endsWith(".msa")) { else if (buildFile.getName().endsWith(ToolDefinitions.MSA_EXTENSION)) {
File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform); File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);
System.out.println("Using FPD file [" + tmpFile.getPath() + "] as active platform. "); System.out.println("Using the FPD file [" + tmpFile.getPath() + "] for the active platform. ");
System.out.println("Start to build MSA file [" + buildFile.getPath() + "] ..>> "); System.out.println("Processing the MSA file [" + buildFile.getPath() + "] ..>> ");
GenBuildTask genBuildTask = new GenBuildTask(); GenBuildTask genBuildTask = new GenBuildTask();
genBuildTask.setSingleModuleBuild(true); genBuildTask.setSingleModuleBuild(true);
genBuildTask.setType(type); genBuildTask.setType(type);
@ -191,26 +188,22 @@ public class FrameworkBuildTask extends Task{
private File intercommuniteWithUser(){ private File intercommuniteWithUser(){
File file = null; File file = null;
if (fpdFiles.size() + msaFiles.size() > 1) { if (fpdFiles.size() > 1) {
File[] allFiles = new File[fpdFiles.size() + msaFiles.size()]; File[] allFiles = new File[fpdFiles.size()];
int index = 0; int index = 0;
Iterator<File> iter = fpdFiles.iterator(); Iterator<File> iter = fpdFiles.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
allFiles[index] = iter.next(); allFiles[index] = iter.next();
index++; index++;
} }
iter = msaFiles.iterator();
while (iter.hasNext()) { System.out.println("Finding " + allFiles.length + " FPD files: ");
allFiles[index] = iter.next();
index++;
}
System.out.println("Find " + allFiles.length + " FPD and MSA files: ");
for (int i = 0; i < allFiles.length; i++) { for (int i = 0; i < allFiles.length; i++) {
System.out.println("[" + (i + 1) + "]: " + allFiles[i].getName()); System.out.println("[" + (i + 1) + "]: " + allFiles[i].getName());
} }
boolean flag = true; boolean flag = true;
System.out.print("Please select one file to build:[1] "); System.out.print("Please select one of the following FPD files to build:[1] ");
do{ do{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try { try {
@ -234,13 +227,9 @@ public class FrameworkBuildTask extends Task{
flag = true; flag = true;
} }
} while (flag); } while (flag);
} } else if (fpdFiles.size() == 1) {
else if (fpdFiles.size() == 1) {
file = fpdFiles.toArray(new File[1])[0]; file = fpdFiles.toArray(new File[1])[0];
} }
else if (msaFiles.size() == 1) {
file = msaFiles.toArray(new File[1])[0];
}
return file; return file;
} }
@ -248,54 +237,50 @@ public class FrameworkBuildTask extends Task{
public void setType(String type) { public void setType(String type) {
if (type.equalsIgnoreCase("clean") || type.equalsIgnoreCase("cleanall")) { if (type.equalsIgnoreCase("clean") || type.equalsIgnoreCase("cleanall")) {
this.type = type.toLowerCase(); this.type = type.toLowerCase();
} } else {
else {
this.type = "all"; this.type = "all";
} }
} }
private void readTargetFile(){ private void readTargetFile(){
try { try {
String targetFile = getProject().getProperty("WORKSPACE_DIR") + File.separatorChar String targetFile = getProject().getProperty("WORKSPACE_DIR") + File.separatorChar + targetFilename;
+ "Tools" + File.separatorChar + "Conf" + File.separatorChar + targetFilename;
String[][] targetFileInfo = ConfigReader.parse(targetFile); String[][] targetFileInfo = ConfigReader.parse(targetFile);
// //
// Get ToolChain Info from target.txt // Get ToolChain Info from target.txt
// //
ToolChainInfo envToolChainInfo = new ToolChainInfo(); ToolChainInfo envToolChainInfo = new ToolChainInfo();
String str = getValue("TARGET", targetFileInfo); String str = getValue(ToolDefinitions.TARGET_KEY_TARGET, targetFileInfo);
if (str == null || str.trim().equals("")) { if (str == null || str.trim().equals("")) {
envToolChainInfo.addTargets("*"); envToolChainInfo.addTargets("*");
} } else {
else {
envToolChainInfo.addTargets(str); envToolChainInfo.addTargets(str);
} }
str = getValue("TOOL_CHAIN_TAG", targetFileInfo); str = getValue(ToolDefinitions.TARGET_KEY_TOOLCHAIN, targetFileInfo);
if (str == null || str.trim().equals("")) { if (str == null || str.trim().equals("")) {
envToolChainInfo.addTagnames("*"); envToolChainInfo.addTagnames("*");
} } else {
else {
envToolChainInfo.addTagnames(str); envToolChainInfo.addTagnames(str);
} }
str = getValue("TARGET_ARCH", targetFileInfo); str = getValue(ToolDefinitions.TARGET_KEY_ARCH, targetFileInfo);
if (str == null || str.trim().equals("")) { if (str == null || str.trim().equals("")) {
envToolChainInfo.addArchs("*"); envToolChainInfo.addArchs("*");
} } else {
else {
envToolChainInfo.addArchs(str); envToolChainInfo.addArchs(str);
} }
GlobalData.setToolChainEnvInfo(envToolChainInfo); GlobalData.setToolChainEnvInfo(envToolChainInfo);
str = getValue("TOOL_CHAIN_CONF", targetFileInfo); str = getValue(ToolDefinitions.TARGET_KEY_TOOLS_DEF, targetFileInfo);
if (str != null && str.trim().length() > 0) { if (str != null && str.trim().length() > 0) {
toolsDefFilename = str; toolsDefFilename = str;
} }
str = getValue("ACTIVE_PLATFORM", targetFileInfo); str = getValue(ToolDefinitions.TARGET_KEY_ACTIVE_PLATFORM, targetFileInfo);
if (str != null && ! str.trim().equals("")) { if (str != null && ! str.trim().equals("")) {
if ( ! str.endsWith(".fpd")) { if ( ! str.endsWith(".fpd")) {
throw new BuildException("FPD file's file extension must be \".fpd\""); throw new BuildException("FPD file's extension must be \"" + ToolDefinitions.FPD_EXTENSION + "\"!");
} }
activePlatform = str; activePlatform = str;
} }

View File

@ -32,6 +32,7 @@ import org.apache.tools.ant.taskdefs.Ant;
import org.apache.tools.ant.taskdefs.Property; import org.apache.tools.ant.taskdefs.Property;
import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlObject;
import org.tianocore.common.definitions.ToolDefinitions;
import org.tianocore.common.exception.EdkException; import org.tianocore.common.exception.EdkException;
import org.tianocore.common.logger.EdkLog; import org.tianocore.common.logger.EdkLog;
import org.tianocore.build.autogen.AutoGen; import org.tianocore.build.autogen.AutoGen;
@ -49,11 +50,15 @@ import org.tianocore.build.tools.ModuleItem;
/** /**
<p> <p>
<code>GenBuildTask</code> is an ANT task that can be used in ANT build <code>GenBuildTask</code> is an ANT task that can be used in ANT build
system. The main function of this task is to parse module's surface area, system.
<p>The main function of this task is to parse module's surface area (MSA),
then generate the corresponding <em>BaseName_build.xml</em> (the real ANT then generate the corresponding <em>BaseName_build.xml</em> (the real ANT
build script) and call this to build the module. The whole process including: build script) and call this to build the module. The whole process including:
1. generate AutoGen.c and AutoGen.h; 2. build all dependent library instances; 1. generate AutoGen.c and AutoGen.h;
3. build all source files inlcude AutoGen.c; 4. generate sections; 2. build all dependent library instances;
3. build all source files inlcude AutoGen.c;
4. generate sections;
5. generate FFS file if it is driver module while LIB file if it is Library module. 5. generate FFS file if it is driver module while LIB file if it is Library module.
</p> </p>
@ -426,9 +431,9 @@ public class GenBuildTask extends Ant {
// Set cmd, like CC, DLINK // Set cmd, like CC, DLINK
// //
String[] key = new String[]{target, toolchain, fpdModuleId.getArch(), cmd[m], null}; String[] key = new String[]{target, toolchain, fpdModuleId.getArch(), cmd[m], null};
key[4] = "PATH"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_PATH;
String cmdPath = GlobalData.getCommandSetting(key, fpdModuleId); String cmdPath = GlobalData.getCommandSetting(key, fpdModuleId);
key[4] = "NAME"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME;
String cmdName = GlobalData.getCommandSetting(key, fpdModuleId); String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);
File cmdFile = new File(cmdPath + File.separatorChar + cmdName); File cmdFile = new File(cmdPath + File.separatorChar + cmdName);
getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/")); getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));
@ -436,7 +441,7 @@ public class GenBuildTask extends Ant {
// //
// set CC_FLAGS // set CC_FLAGS
// //
key[4] = "FLAGS"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS;
String cmdFlags = GlobalData.getCommandSetting(key, fpdModuleId); String cmdFlags = GlobalData.getCommandSetting(key, fpdModuleId);
Set<String> addset = new LinkedHashSet<String>(); Set<String> addset = new LinkedHashSet<String>();
Set<String> subset = new LinkedHashSet<String>(); Set<String> subset = new LinkedHashSet<String>();
@ -446,7 +451,7 @@ public class GenBuildTask extends Ant {
// //
// Set CC_EXT // Set CC_EXT
// //
key[4] = "EXT"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_EXT;
String extName = GlobalData.getCommandSetting(key, fpdModuleId); String extName = GlobalData.getCommandSetting(key, fpdModuleId);
if ( extName != null && ! extName.equalsIgnoreCase("")) { if ( extName != null && ! extName.equalsIgnoreCase("")) {
getProject().setProperty(cmd[m] + "_EXT", extName); getProject().setProperty(cmd[m] + "_EXT", extName);
@ -457,7 +462,7 @@ public class GenBuildTask extends Ant {
// //
// set CC_FAMILY // set CC_FAMILY
// //
key[4] = "FAMILY"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY;
String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId); String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId);
if (toolChainFamily != null) { if (toolChainFamily != null) {
getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily); getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);
@ -466,7 +471,7 @@ public class GenBuildTask extends Ant {
// //
// set CC_SPATH // set CC_SPATH
// //
key[4] = "SPATH"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_SPATH;
String spath = GlobalData.getCommandSetting(key, fpdModuleId); String spath = GlobalData.getCommandSetting(key, fpdModuleId);
if (spath != null) { if (spath != null) {
getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/")); getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/"));
@ -477,7 +482,7 @@ public class GenBuildTask extends Ant {
// //
// set CC_DPATH // set CC_DPATH
// //
key[4] = "DPATH"; key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_DPATH;
String dpath = GlobalData.getCommandSetting(key, fpdModuleId); String dpath = GlobalData.getCommandSetting(key, fpdModuleId);
if (dpath != null) { if (dpath != null) {
getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/")); getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/"));

View File

@ -33,13 +33,8 @@ import java.util.Set;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlObject;
import org.tianocore.GuidsDocument;
import org.tianocore.LibraryClassDocument.LibraryClass;
import org.tianocore.PPIsDocument;
import org.tianocore.ProtocolsDocument;
import org.tianocore.build.exception.*; import org.tianocore.build.exception.*;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
import org.tianocore.build.global.Spd;
import org.tianocore.build.global.SurfaceAreaQuery; import org.tianocore.build.global.SurfaceAreaQuery;
import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.ModuleIdentification;
import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.id.PackageIdentification;
@ -2043,7 +2038,6 @@ public class AutoGen {
private void collectLibInstanceInfo(){ private void collectLibInstanceInfo(){
int index; int index;
String moduleType = SurfaceAreaQuery.getModuleType();
String libConstructName = null; String libConstructName = null;
String libDestructName = null; String libDestructName = null;
String[] setVirtuals = null; String[] setVirtuals = null;

View File

@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlObject;
import org.tianocore.LibraryClassDocument.LibraryClass;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
import org.tianocore.build.global.SurfaceAreaQuery; import org.tianocore.build.global.SurfaceAreaQuery;

View File

@ -15,7 +15,6 @@
**/ **/
package org.tianocore.build.autogen; package org.tianocore.build.autogen;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;

View File

@ -32,6 +32,7 @@ import org.apache.tools.ant.taskdefs.Ant;
import org.apache.tools.ant.taskdefs.Property; import org.apache.tools.ant.taskdefs.Property;
import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlObject;
import org.tianocore.common.definitions.EdkDefinitions;
import org.tianocore.common.exception.EdkException; import org.tianocore.common.exception.EdkException;
import org.tianocore.pcd.action.ActionMessage; import org.tianocore.pcd.action.ActionMessage;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
@ -530,13 +531,7 @@ public class FpdParserTask extends Task {
throw new BuildException("Module type is not specified."); throw new BuildException("Module type is not specified.");
} }
String[][] suffix = { { "BASE", ".FFS"}, String[][] suffix = EdkDefinitions.ModuleTypeExtensions;
{ "SEC", ".SEC" }, { "PEI_CORE", ".PEI" },
{ "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" },
{ "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" },
{ "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" },
{ "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" },
{ "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } };
for (int i = 0; i < suffix.length; i++) { for (int i = 0; i < suffix.length; i++) {
if (suffix[i][0].equalsIgnoreCase(moduleType)) { if (suffix[i][0].equalsIgnoreCase(moduleType)) {

View File

@ -16,14 +16,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
package org.tianocore.build.pcd.action; package org.tianocore.build.pcd.action;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.tianocore.build.autogen.CommonDefinition; import org.tianocore.build.autogen.CommonDefinition;
import org.tianocore.build.exception.PcdAutogenException;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.ModuleIdentification;
import org.tianocore.pcd.action.ActionMessage; import org.tianocore.pcd.action.ActionMessage;

View File

@ -13,14 +13,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
package org.tianocore.build.pcd.action; package org.tianocore.build.pcd.action;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import org.tianocore.build.global.GlobalData;
import org.tianocore.pcd.entity.DynamicTokenValue; import org.tianocore.pcd.entity.DynamicTokenValue;
import org.tianocore.pcd.entity.Token; import org.tianocore.pcd.entity.Token;
import org.tianocore.pcd.exception.EntityException; import org.tianocore.pcd.exception.EntityException;

View File

@ -30,7 +30,6 @@ import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitio
import org.tianocore.PcdBuildDefinitionDocument; import org.tianocore.PcdBuildDefinitionDocument;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.build.exception.PlatformPcdPreprocessBuildException; import org.tianocore.build.exception.PlatformPcdPreprocessBuildException;
import org.tianocore.build.fpd.FpdParserTask;
import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.GlobalData;
import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.build.id.FpdModuleIdentification;
import org.tianocore.pcd.action.ActionMessage; import org.tianocore.pcd.action.ActionMessage;

View File

@ -15,9 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
package org.tianocore.build.toolchain; package org.tianocore.build.toolchain;
import java.util.HashMap;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**

View File

@ -113,7 +113,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
public int compareTo(ToolChainKey dstKey) { public int compareTo(ToolChainKey dstKey) {
String[] dstKeySet = dstKey.getKeySet(); String[] dstKeySet = dstKey.getKeySet();
int result = 0; int result = 0;
for (int i = 0; i < this.keyLength; ++i) { for (int i = 0; i < ToolChainKey.keyLength; ++i) {
result = this.keySet[i].compareToIgnoreCase(dstKeySet[i]); result = this.keySet[i].compareToIgnoreCase(dstKeySet[i]);
if (result != 0) { if (result != 0) {
break; break;
@ -138,11 +138,11 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
return true; return true;
} }
if (dstKeySet.length != this.keyLength) { if (dstKeySet.length != ToolChainKey.keyLength) {
return false; return false;
} }
for (int i = 0; i < this.keyLength; ++i) { for (int i = 0; i < ToolChainKey.keyLength; ++i) {
if (!this.keySet[i].equalsIgnoreCase(dstKeySet[i])) { if (!this.keySet[i].equalsIgnoreCase(dstKeySet[i])) {
return false; return false;
} }
@ -157,16 +157,16 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
@param keySet The string array of key value @param keySet The string array of key value
**/ **/
public void setKey(String[] keySet) throws EdkException { public void setKey(String[] keySet) throws EdkException {
if (keySet.length != this.keyLength) { if (keySet.length != ToolChainKey.keyLength) {
throw new EdkException("Invalid ToolChain key"); throw new EdkException("Invalid ToolChain key");
} }
// //
// Clone the string array because we don't want to change original one // Clone the string array because we don't want to change original one
// //
this.keySet = new String[this.keyLength]; this.keySet = new String[ToolChainKey.keyLength];
System.arraycopy(keySet, 0, this.keySet, 0, this.keyLength); System.arraycopy(keySet, 0, this.keySet, 0, ToolChainKey.keyLength);
for (int i = 0; i < this.keyLength; ++i) { for (int i = 0; i < ToolChainKey.keyLength; ++i) {
if (this.keySet[i] == null || this.keySet[i].length() == 0) { if (this.keySet[i] == null || this.keySet[i].length() == 0) {
this.keySet[i] = "*"; this.keySet[i] = "*";
} }
@ -186,7 +186,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
@param index The key part index @param index The key part index
**/ **/
public void setKey(String keySetString, int index) throws EdkException { public void setKey(String keySetString, int index) throws EdkException {
if (index >= this.keyLength) { if (index >= ToolChainKey.keyLength) {
throw new EdkException("Invalid ToolChain key index"); throw new EdkException("Invalid ToolChain key index");
} }
@ -213,7 +213,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
public void setKey(String keyString) throws EdkException { public void setKey(String keyString) throws EdkException {
this.keySet = keyString.split(this.delimiter); this.keySet = keyString.split(this.delimiter);
if (this.keySet.length != this.keyLength) { if (this.keySet.length != ToolChainKey.keyLength) {
throw new EdkException("Invalid ToolChain key"); throw new EdkException("Invalid ToolChain key");
} }
@ -233,7 +233,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
public void setKey(String keyString, String delimiter) throws EdkException { public void setKey(String keyString, String delimiter) throws EdkException {
this.keySet = keyString.split(delimiter); this.keySet = keyString.split(delimiter);
if (this.keySet.length != this.keyLength) { if (this.keySet.length != ToolChainKey.keyLength) {
throw new EdkException("Invalid ToolChain key"); throw new EdkException("Invalid ToolChain key");
} }
@ -264,7 +264,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainK
StringBuffer keyStringBuf = new StringBuffer(64); StringBuffer keyStringBuf = new StringBuffer(64);
keyStringBuf.append(this.keySet[0]); keyStringBuf.append(this.keySet[0]);
for (int i = 1; i < this.keyLength; ++i) { for (int i = 1; i < ToolChainKey.keyLength; ++i) {
keyStringBuf.append(this.delimiter); keyStringBuf.append(this.delimiter);
keyStringBuf.append(this.keySet[i]); keyStringBuf.append(this.keySet[i]);
} }