from Common.MultipleWorkspace import MultipleWorkspace as mws\r
from Common.BuildToolError import *\r
from Common.Misc import *\r
-from Common.String import *\r
+from Common.StringUtils import *\r
from BuildEngine import *\r
import Common.GlobalData as GlobalData\r
from collections import OrderedDict\r
self.ResultFileList = []\r
self.IntermediateDirectoryList = ["$(DEBUG_DIR)", "$(OUTPUT_DIR)"]\r
\r
- self.SourceFileDatabase = {} # {file type : file path}\r
- self.DestFileDatabase = {} # {file type : file path}\r
self.FileBuildTargetList = [] # [(src, target string)]\r
self.BuildTargetList = [] # [target string]\r
self.PendingBuildTargetList = [] # [FileBuildRule objects]\r
ImageEntryPoint = "_ModuleEntryPoint"\r
\r
for k, v in self._AutoGenObject.Module.Defines.iteritems():\r
- if k not in self._AutoGenObject.Macros.keys():\r
+ if k not in self._AutoGenObject.Macros:\r
self._AutoGenObject.Macros[k] = v\r
\r
- if 'MODULE_ENTRY_POINT' not in self._AutoGenObject.Macros.keys():\r
+ if 'MODULE_ENTRY_POINT' not in self._AutoGenObject.Macros:\r
self._AutoGenObject.Macros['MODULE_ENTRY_POINT'] = ModuleEntryPoint\r
- if 'ARCH_ENTRY_POINT' not in self._AutoGenObject.Macros.keys():\r
+ if 'ARCH_ENTRY_POINT' not in self._AutoGenObject.Macros:\r
self._AutoGenObject.Macros['ARCH_ENTRY_POINT'] = ArchEntryPoint\r
- if 'IMAGE_ENTRY_POINT' not in self._AutoGenObject.Macros.keys():\r
+ if 'IMAGE_ENTRY_POINT' not in self._AutoGenObject.Macros:\r
self._AutoGenObject.Macros['IMAGE_ENTRY_POINT'] = ImageEntryPoint\r
\r
PCI_COMPRESS_Flag = False\r
RespFileList = os.path.join(self._AutoGenObject.OutputDir, 'respfilelist.txt')\r
if RespDict:\r
RespFileListContent = ''\r
- for Resp in RespDict.keys():\r
+ for Resp in RespDict:\r
RespFile = os.path.join(self._AutoGenObject.OutputDir, str(Resp).lower() + '.txt')\r
StrList = RespDict[Resp].split(' ')\r
UnexpandMacro = []\r
SingleCommandLength = len(SingleCommand)\r
SingleCommandList = SingleCommand.split()\r
if len(SingleCommandList) > 0:\r
- for Flag in FlagDict.keys():\r
+ for Flag in FlagDict:\r
if '$('+ Flag +')' in SingleCommandList[0]:\r
Tool = Flag\r
break\r
if 'FLAGS' not in self._AutoGenObject._BuildOption[Tool]:\r
EdkLogger.error("build", AUTOGEN_ERROR, "%s_FLAGS doesn't exist in %s ToolChain and %s Arch." %(Tool, self._AutoGenObject.ToolChain, self._AutoGenObject.Arch), ExtraData="[%s]" % str(self._AutoGenObject))\r
Str = self._AutoGenObject._BuildOption[Tool]['FLAGS']\r
- for Option in self._AutoGenObject.BuildOption.keys():\r
+ for Option in self._AutoGenObject.BuildOption:\r
for Attr in self._AutoGenObject.BuildOption[Option]:\r
if Str.find(Option + '_' + Attr) != -1:\r
Str = Str.replace('$(' + Option + '_' + Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])\r
while(Str.find('$(') != -1):\r
- for macro in self._AutoGenObject.Macros.keys():\r
+ for macro in self._AutoGenObject.Macros:\r
MacroName = '$('+ macro + ')'\r
if (Str.find(MacroName) != -1):\r
Str = Str.replace(MacroName, self._AutoGenObject.Macros[macro])\r
SingleCommandLength += self._AutoGenObject.IncludePathLength + len(IncPrefix) * len(self._AutoGenObject._IncludePathList)\r
elif item.find('$(') != -1:\r
Str = item\r
- for Option in self._AutoGenObject.BuildOption.keys():\r
+ for Option in self._AutoGenObject.BuildOption:\r
for Attr in self._AutoGenObject.BuildOption[Option]:\r
if Str.find(Option + '_' + Attr) != -1:\r
Str = Str.replace('$(' + Option + '_' + Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])\r
while(Str.find('$(') != -1):\r
- for macro in self._AutoGenObject.Macros.keys():\r
+ for macro in self._AutoGenObject.Macros:\r
MacroName = '$('+ macro + ')'\r
if (Str.find(MacroName) != -1):\r
Str = Str.replace(MacroName, self._AutoGenObject.Macros[macro])\r
FlagDict[Tool]['Value'] = True\r
\r
# generate the response file content by combine the FLAGS and INC\r
- for Flag in FlagDict.keys():\r
+ for Flag in FlagDict:\r
if FlagDict[Flag]['Value']:\r
Key = Flag + '_RESP'\r
RespMacro = FlagDict[Flag]['Macro'].replace('FLAGS', 'RESP')\r
Value = self._AutoGenObject.BuildOption[Flag]['FLAGS']\r
for inc in self._AutoGenObject._IncludePathList:\r
Value += ' ' + IncPrefix + inc\r
- for Option in self._AutoGenObject.BuildOption.keys():\r
+ for Option in self._AutoGenObject.BuildOption:\r
for Attr in self._AutoGenObject.BuildOption[Option]:\r
if Value.find(Option + '_' + Attr) != -1:\r
Value = Value.replace('$(' + Option + '_' + Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])\r
while (Value.find('$(') != -1):\r
- for macro in self._AutoGenObject.Macros.keys():\r
+ for macro in self._AutoGenObject.Macros:\r
MacroName = '$('+ macro + ')'\r
if (Value.find(MacroName) != -1):\r
Value = Value.replace(MacroName, self._AutoGenObject.Macros[macro])\r