summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/build/build.py
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2019-04-13 16:02:02 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-08-09 23:15:51 +0800
commitdb01c8e3d87305a406286e972f19b00c5c6960ab (patch)
tree68b75b18c650656b3e5c7204be1e8b7e6f666d63 /BaseTools/Source/Python/build/build.py
parent4b1b7c1913092d73d689d8086dcfa579c0217dc8 (diff)
downloadedk2-db01c8e3d87305a406286e972f19b00c5c6960ab.tar.gz
edk2-db01c8e3d87305a406286e972f19b00c5c6960ab.tar.bz2
edk2-db01c8e3d87305a406286e972f19b00c5c6960ab.zip
BaseTools: Singleton the object to handle build conf file
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1875 The build config files are target.txt, build rule, tooldef During a build, the config is not changed, so the object to handle them need to be singleton. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/build/build.py')
-rw-r--r--BaseTools/Source/Python/build/build.py29
1 files changed, 6 insertions, 23 deletions
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index 6bc528974d..07693b9735 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -30,8 +30,8 @@ from subprocess import *
from Common import Misc as Utils
from Common.LongFilePathSupport import OpenLongFilePath as open
-from Common.TargetTxtClassObject import TargetTxtClassObject
-from Common.ToolDefClassObject import ToolDefClassObject
+from Common.TargetTxtClassObject import TargetTxt
+from Common.ToolDefClassObject import ToolDef
from Common.DataType import *
from Common.BuildVersion import gBUILD_VERSION
from AutoGen.AutoGen import *
@@ -716,8 +716,8 @@ class Build():
self.ConfDirectory = BuildOptions.ConfDirectory
self.SpawnMode = True
self.BuildReport = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType)
- self.TargetTxt = TargetTxtClassObject()
- self.ToolDef = ToolDefClassObject()
+ self.TargetTxt = TargetTxt
+ self.ToolDef = ToolDef
self.AutoGenTime = 0
self.MakeTime = 0
self.GenFdsTime = 0
@@ -816,8 +816,8 @@ class Build():
EdkLogger.quiet("%-16s = %s" % ("POSTBUILD", self.Postbuild))
if self.Prebuild:
self.LaunchPrebuild()
- self.TargetTxt = TargetTxtClassObject()
- self.ToolDef = ToolDefClassObject()
+ self.TargetTxt = TargetTxt
+ self.ToolDef = ToolDef
if not (self.LaunchPrebuildFlag and os.path.exists(self.PlatformBuildPath)):
self.InitBuild()
@@ -829,23 +829,6 @@ class Build():
# This method will parse target.txt and get the build configurations.
#
def LoadConfiguration(self):
- #
- # Check target.txt and tools_def.txt and Init them
- #
- BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, gBuildConfiguration))
- if os.path.isfile(BuildConfigurationFile) == True:
- StatusCode = self.TargetTxt.LoadTargetTxtFile(BuildConfigurationFile)
-
- ToolDefinitionFile = self.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
- if ToolDefinitionFile == '':
- ToolDefinitionFile = gToolsDefinition
- ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile))
- if os.path.isfile(ToolDefinitionFile) == True:
- StatusCode = self.ToolDef.LoadToolDefFile(ToolDefinitionFile)
- else:
- EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=ToolDefinitionFile)
- else:
- EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=BuildConfigurationFile)
# if no ARCH given in command line, get it from target.txt
if not self.ArchList: