diff --git a/Tools/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java b/Tools/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java index 2b510c3b02..74e783d904 100644 --- a/Tools/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java +++ b/Tools/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java @@ -80,7 +80,7 @@ public class ToolDefinitions { 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_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 diff --git a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java index bb8ecf33cc..8d9704be1e 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java +++ b/Tools/Source/GenBuild/org/tianocore/build/FfsProcess.java @@ -25,6 +25,7 @@ import org.tianocore.BuildOptionsDocument; import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.SurfaceAreaQuery; import org.tianocore.build.id.FpdModuleIdentification; +import org.tianocore.common.definitions.EdkDefinitions; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -82,19 +83,7 @@ public class FfsProcess { /// /// mapping from section type to section output file extension /// - public static final String[][] sectionExt = { { "EFI_SECTION_FREEFORM_SUBTYPE_GUID", ".sec" }, - { "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" } }; + public static final String[][] sectionExt = EdkDefinitions.SectionTypeExtensions; /** search in the type, if componentType is listed in type, return true; diff --git a/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java index 6cdbbe5247..14de2d824d 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java @@ -27,6 +27,7 @@ import org.tianocore.build.fpd.FpdParserTask; import org.tianocore.build.global.GlobalData; import org.tianocore.build.toolchain.ConfigReader; import org.tianocore.build.toolchain.ToolChainInfo; +import org.tianocore.common.definitions.ToolDefinitions; public class FrameworkBuildTask extends Task{ @@ -36,9 +37,11 @@ public class FrameworkBuildTask extends Task{ private Set msaFiles = new LinkedHashSet(); - 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; @@ -66,12 +69,12 @@ public class FrameworkBuildTask extends Task{ // 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 // 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 // @@ -98,8 +101,7 @@ public class FrameworkBuildTask extends Task{ // File workspacePath = new File(getProject().getProperty("WORKSPACE")); getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/")); - GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db", - workspacePath.getPath(), toolsDefFilename); + GlobalData.initInfo(dbFilename, workspacePath.getPath(), toolsDefFilename); @@ -112,38 +114,33 @@ public class FrameworkBuildTask extends Task{ // File buildFile = null; if (msaFiles.size() > 1) { - throw new BuildException("More than one MSA file under current directory. It is not allowd. "); - } - else if (msaFiles.size() == 1 && activePlatform == null) { - 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) { + throw new BuildException("Having more than one MSA file in a directory is not allowed!"); + } else if (msaFiles.size() == 1 && activePlatform == null) { + throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. "); + } else if (msaFiles.size() == 1 && activePlatform != null) { // // Build the single module // buildFile = msaFiles.toArray(new File[1])[0]; - } - else if (activePlatform != null) { + } else if (activePlatform != null) { 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]; - } - else if (fpdFiles.size() > 1) { + } else if (fpdFiles.size() > 1) { buildFile = intercommuniteWithUser(); } // // If there is no build files or FPD files or MSA files, stop build // 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) // - if (buildFile.getName().endsWith(".fpd")) { - System.out.println("Start to build FPD file [" + buildFile.getPath() + "] ..>> "); + if (buildFile.getName().endsWith(ToolDefinitions.FPD_EXTENSION)) { + System.out.println("Processing the FPD file [" + buildFile.getPath() + "] ..>> "); FpdParserTask fpdParserTask = new FpdParserTask(); fpdParserTask.setType(type); fpdParserTask.setProject(getProject()); @@ -154,10 +151,10 @@ public class FrameworkBuildTask extends Task{ // // 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); - System.out.println("Using FPD file [" + tmpFile.getPath() + "] as active platform. "); - System.out.println("Start to build MSA file [" + buildFile.getPath() + "] ..>> "); + System.out.println("Using the FPD file [" + tmpFile.getPath() + "] for the active platform. "); + System.out.println("Processing the MSA file [" + buildFile.getPath() + "] ..>> "); GenBuildTask genBuildTask = new GenBuildTask(); genBuildTask.setSingleModuleBuild(true); genBuildTask.setType(type); @@ -191,26 +188,22 @@ public class FrameworkBuildTask extends Task{ private File intercommuniteWithUser(){ File file = null; - if (fpdFiles.size() + msaFiles.size() > 1) { - File[] allFiles = new File[fpdFiles.size() + msaFiles.size()]; + if (fpdFiles.size() > 1) { + File[] allFiles = new File[fpdFiles.size()]; int index = 0; Iterator iter = fpdFiles.iterator(); while (iter.hasNext()) { allFiles[index] = iter.next(); index++; } - iter = msaFiles.iterator(); - while (iter.hasNext()) { - allFiles[index] = iter.next(); - index++; - } - System.out.println("Find " + allFiles.length + " FPD and MSA files: "); + + System.out.println("Finding " + allFiles.length + " FPD files: "); for (int i = 0; i < allFiles.length; i++) { System.out.println("[" + (i + 1) + "]: " + allFiles[i].getName()); } 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{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { @@ -234,13 +227,9 @@ public class FrameworkBuildTask extends Task{ flag = true; } } while (flag); - } - else if (fpdFiles.size() == 1) { + } else if (fpdFiles.size() == 1) { file = fpdFiles.toArray(new File[1])[0]; } - else if (msaFiles.size() == 1) { - file = msaFiles.toArray(new File[1])[0]; - } return file; } @@ -248,54 +237,50 @@ public class FrameworkBuildTask extends Task{ public void setType(String type) { if (type.equalsIgnoreCase("clean") || type.equalsIgnoreCase("cleanall")) { this.type = type.toLowerCase(); - } - else { + } else { this.type = "all"; } } private void readTargetFile(){ try { - String targetFile = getProject().getProperty("WORKSPACE_DIR") + File.separatorChar - + "Tools" + File.separatorChar + "Conf" + File.separatorChar + targetFilename; + String targetFile = getProject().getProperty("WORKSPACE_DIR") + File.separatorChar + targetFilename; + String[][] targetFileInfo = ConfigReader.parse(targetFile); // // Get ToolChain Info from target.txt // ToolChainInfo envToolChainInfo = new ToolChainInfo(); - String str = getValue("TARGET", targetFileInfo); + String str = getValue(ToolDefinitions.TARGET_KEY_TARGET, targetFileInfo); if (str == null || str.trim().equals("")) { envToolChainInfo.addTargets("*"); - } - else { + } else { envToolChainInfo.addTargets(str); } - str = getValue("TOOL_CHAIN_TAG", targetFileInfo); + str = getValue(ToolDefinitions.TARGET_KEY_TOOLCHAIN, targetFileInfo); if (str == null || str.trim().equals("")) { envToolChainInfo.addTagnames("*"); - } - else { + } else { envToolChainInfo.addTagnames(str); } - str = getValue("TARGET_ARCH", targetFileInfo); + str = getValue(ToolDefinitions.TARGET_KEY_ARCH, targetFileInfo); if (str == null || str.trim().equals("")) { envToolChainInfo.addArchs("*"); - } - else { + } else { envToolChainInfo.addArchs(str); } GlobalData.setToolChainEnvInfo(envToolChainInfo); - str = getValue("TOOL_CHAIN_CONF", targetFileInfo); + str = getValue(ToolDefinitions.TARGET_KEY_TOOLS_DEF, targetFileInfo); if (str != null && str.trim().length() > 0) { toolsDefFilename = str; } - str = getValue("ACTIVE_PLATFORM", targetFileInfo); + str = getValue(ToolDefinitions.TARGET_KEY_ACTIVE_PLATFORM, targetFileInfo); if (str != null && ! str.trim().equals("")) { 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; } diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java index adc419c72a..b82c28c413 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -32,6 +32,7 @@ import org.apache.tools.ant.taskdefs.Ant; import org.apache.tools.ant.taskdefs.Property; import org.apache.xmlbeans.XmlObject; +import org.tianocore.common.definitions.ToolDefinitions; import org.tianocore.common.exception.EdkException; import org.tianocore.common.logger.EdkLog; import org.tianocore.build.autogen.AutoGen; @@ -49,11 +50,15 @@ import org.tianocore.build.tools.ModuleItem; /**

GenBuildTask 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. + +

The main function of this task is to parse module's surface area (MSA), then generate the corresponding BaseName_build.xml (the real ANT 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; - 3. build all source files inlcude AutoGen.c; 4. generate sections; + 1. generate AutoGen.c and AutoGen.h; + 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.

@@ -426,9 +431,9 @@ public class GenBuildTask extends Ant { // Set cmd, like CC, DLINK // 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); - key[4] = "NAME"; + key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME; String cmdName = GlobalData.getCommandSetting(key, fpdModuleId); File cmdFile = new File(cmdPath + File.separatorChar + cmdName); getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/")); @@ -436,7 +441,7 @@ public class GenBuildTask extends Ant { // // set CC_FLAGS // - key[4] = "FLAGS"; + key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS; String cmdFlags = GlobalData.getCommandSetting(key, fpdModuleId); Set addset = new LinkedHashSet(); Set subset = new LinkedHashSet(); @@ -446,7 +451,7 @@ public class GenBuildTask extends Ant { // // Set CC_EXT // - key[4] = "EXT"; + key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_EXT; String extName = GlobalData.getCommandSetting(key, fpdModuleId); if ( extName != null && ! extName.equalsIgnoreCase("")) { getProject().setProperty(cmd[m] + "_EXT", extName); @@ -457,7 +462,7 @@ public class GenBuildTask extends Ant { // // set CC_FAMILY // - key[4] = "FAMILY"; + key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY; String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId); if (toolChainFamily != null) { getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily); @@ -466,7 +471,7 @@ public class GenBuildTask extends Ant { // // set CC_SPATH // - key[4] = "SPATH"; + key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_SPATH; String spath = GlobalData.getCommandSetting(key, fpdModuleId); if (spath != null) { getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/")); @@ -477,7 +482,7 @@ public class GenBuildTask extends Ant { // // set CC_DPATH // - key[4] = "DPATH"; + key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_DPATH; String dpath = GlobalData.getCommandSetting(key, fpdModuleId); if (dpath != null) { getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/")); diff --git a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java index 28e72af699..4a47a9fb2f 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java +++ b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java @@ -33,13 +33,8 @@ import java.util.Set; import org.apache.tools.ant.BuildException; 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.global.GlobalData; -import org.tianocore.build.global.Spd; import org.tianocore.build.global.SurfaceAreaQuery; import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification; @@ -2043,7 +2038,6 @@ public class AutoGen { private void collectLibInstanceInfo(){ int index; - String moduleType = SurfaceAreaQuery.getModuleType(); String libConstructName = null; String libDestructName = null; String[] setVirtuals = null; diff --git a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java index 8aad4cc001..403b8c32ee 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java +++ b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java @@ -22,7 +22,6 @@ import java.util.List; import java.util.Map; import org.apache.xmlbeans.XmlObject; -import org.tianocore.LibraryClassDocument.LibraryClass; import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.SurfaceAreaQuery; diff --git a/Tools/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java b/Tools/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java index 12deec7d53..244f2550b5 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java +++ b/Tools/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java @@ -15,7 +15,6 @@ **/ package org.tianocore.build.autogen; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; diff --git a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java index 6130ee2be4..edaab68aaa 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java @@ -32,6 +32,7 @@ import org.apache.tools.ant.taskdefs.Ant; import org.apache.tools.ant.taskdefs.Property; import org.apache.xmlbeans.XmlObject; +import org.tianocore.common.definitions.EdkDefinitions; import org.tianocore.common.exception.EdkException; import org.tianocore.pcd.action.ActionMessage; import org.tianocore.build.global.GlobalData; @@ -530,13 +531,7 @@ public class FpdParserTask extends Task { throw new BuildException("Module type is not specified."); } - String[][] suffix = { { "BASE", ".FFS"}, - { "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" } }; + String[][] suffix = EdkDefinitions.ModuleTypeExtensions; for (int i = 0; i < suffix.length; i++) { if (suffix[i][0].equalsIgnoreCase(moduleType)) { diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java index 28bb81853e..f3213c8079 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java @@ -16,14 +16,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ package org.tianocore.build.pcd.action; -import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.tianocore.build.autogen.CommonDefinition; -import org.tianocore.build.exception.PcdAutogenException; import org.tianocore.build.global.GlobalData; import org.tianocore.build.id.ModuleIdentification; import org.tianocore.pcd.action.ActionMessage; diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java index 9f90ba7680..2af4e93318 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java @@ -13,14 +13,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ package org.tianocore.build.pcd.action; -import java.io.File; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; -import org.tianocore.build.global.GlobalData; import org.tianocore.pcd.entity.DynamicTokenValue; import org.tianocore.pcd.entity.Token; import org.tianocore.pcd.exception.EntityException; diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java index 4d2335dfd2..2013b74706 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java @@ -30,7 +30,6 @@ import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitio import org.tianocore.PcdBuildDefinitionDocument; import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.build.exception.PlatformPcdPreprocessBuildException; -import org.tianocore.build.fpd.FpdParserTask; import org.tianocore.build.global.GlobalData; import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.pcd.action.ActionMessage; diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java index 5fb15f3de0..4ccc4c6d91 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java +++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java @@ -15,9 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. package org.tianocore.build.toolchain; -import java.util.HashMap; import java.util.LinkedHashSet; -import java.util.Map; import java.util.Set; /** diff --git a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java index 765d6f913c..11ba4aaee0 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java +++ b/Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java @@ -113,7 +113,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable= this.keyLength) { + if (index >= ToolChainKey.keyLength) { throw new EdkException("Invalid ToolChain key index"); } @@ -213,7 +213,7 @@ public class ToolChainKey implements java.io.Serializable, Comparable