From: wuyizhong Date: Mon, 16 Oct 2006 07:40:59 +0000 (+0000) Subject: Sync TOOLS_DEF's attribute definitions. Since there are two copy attribute definition... X-Git-Tag: edk2-stable201903~24119 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b0a8056223d0fdb3cbd7abf93f872c7876354de7 Sync TOOLS_DEF's attribute definitions. Since there are two copy attribute definitions in ToolDefinitions.java and ToolChainAttribute.java, remove one and only keep one definitions. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1755 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java b/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java index 5a1986f246..dc6d9f772f 100644 --- a/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java +++ b/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java @@ -81,6 +81,8 @@ public class ToolDefinitions { 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 = "FLAGS"; + public final static String TOOLS_DEF_ATTRIBUTE_LIBPATH = "LIBPATH"; + public final static String TOOLS_DEF_ATTRIBUTE_INCLUDEPATH= "INCLUDEPATH"; /// /// Tool Chain Families in the Tools Definition file diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java index 2b1f30fa0d..86fb256e95 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java @@ -35,6 +35,7 @@ import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; import org.tianocore.common.definitions.EdkDefinitions; +import org.tianocore.common.definitions.ToolDefinitions; import org.tianocore.common.exception.EdkException; import org.tianocore.common.logger.EdkLog; import org.tianocore.build.FrameworkBuildTask; @@ -46,7 +47,6 @@ import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.id.PlatformIdentification; import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding; -import org.tianocore.build.toolchain.ToolChainAttribute; import org.tianocore.build.toolchain.ToolChainElement; import org.tianocore.build.toolchain.ToolChainMap; import org.w3c.dom.NamedNodeMap; @@ -545,7 +545,7 @@ public class FpdParserTask extends Task { if (flagString == null) { flagString = ""; } - options[i][flagIndex] = ToolChainAttribute.FLAGS + ""; + options[i][flagIndex] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS; map.put(options[i], flagString.trim()); } diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java index 9138036c78..310381bc14 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java @@ -30,6 +30,7 @@ import java.util.regex.Pattern; import org.apache.xmlbeans.XmlException; 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.pcd.entity.MemoryDatabaseManager; @@ -41,7 +42,6 @@ import org.tianocore.build.id.FpdModuleIdentification; import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.id.PlatformIdentification; -import org.tianocore.build.toolchain.ToolChainAttribute; import org.tianocore.build.toolchain.ToolChainConfig; import org.tianocore.build.toolchain.ToolChainElement; import org.tianocore.build.toolchain.ToolChainInfo; @@ -720,7 +720,7 @@ public class GlobalData { String[] commands = getToolChainInfo().getCommands(); for (int i = 0; i < commands.length; ++i) { - String cmdName = toolsDef.getConfig().get(new String[] {target, toolchain, arch, commands[i], ToolChainAttribute.NAME.toString()}); + String cmdName = toolsDef.getConfig().get(new String[] {target, toolchain, arch, commands[i], ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME}); if (cmdName != null && cmdName.length() != 0) { return true; } @@ -741,7 +741,7 @@ public class GlobalData { if (setting == null) { setting = ""; } - if (!commandDescription[ToolChainElement.ATTRIBUTE.value].equals(ToolChainAttribute.FLAGS.toString())) { + if (!commandDescription[ToolChainElement.ATTRIBUTE.value].equals(ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS)) { return setting; } @@ -752,10 +752,10 @@ public class GlobalData { ToolChainMap option = null; ToolChainKey toolChainFamilyKey = new ToolChainKey(commandDescription); - toolChainFamilyKey.setKey(ToolChainAttribute.FAMILY.toString(), ToolChainElement.ATTRIBUTE.value); + toolChainFamilyKey.setKey(ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY, ToolChainElement.ATTRIBUTE.value); String family = toolChainConfig.get(toolChainFamilyKey); toolChainFamilyKey.setKey(family, ToolChainElement.TOOLCHAIN.value); - toolChainFamilyKey.setKey(ToolChainAttribute.FLAGS.toString(), ToolChainElement.ATTRIBUTE.value); + toolChainFamilyKey.setKey(ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS, ToolChainElement.ATTRIBUTE.value); // // Platform's tool chain family option diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java deleted file mode 100644 index 491d37c431..0000000000 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainAttribute.java +++ /dev/null @@ -1,52 +0,0 @@ -/** @file -ToolChainAttribute class - -This file is to define enumeration value for tool chain attribute names. - -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; - -/** - - ToolChainAttribute is used to define the enumeration value for the attributes - used in tool chain definition file. - - **/ -public class ToolChainAttribute { - private static int nextValue = 0; - - /// - /// "NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS" - /// - public final static ToolChainAttribute NAME = new ToolChainAttribute("NAME"); - public final static ToolChainAttribute PATH = new ToolChainAttribute("PATH"); - public final static ToolChainAttribute DPATH = new ToolChainAttribute("DPATH"); - public final static ToolChainAttribute SPATH = new ToolChainAttribute("SPATH"); - public final static ToolChainAttribute EXT = new ToolChainAttribute("EXT"); - public final static ToolChainAttribute FAMILY = new ToolChainAttribute("FAMILY"); - public final static ToolChainAttribute FLAGS = new ToolChainAttribute("FLAGS"); - - private final String name; - public final int value = nextValue++; - - /** - * Default constructor - */ - private ToolChainAttribute(String name) { - this.name = name; - } - - public String toString() { - return name; - } -} -