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
This commit is contained in:
wuyizhong 2006-10-16 07:40:59 +00:00
parent 51f9486371
commit b0a8056223
4 changed files with 9 additions and 59 deletions

View File

@ -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

View File

@ -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());
}

View File

@ -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

View File

@ -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;
}
}