From c7d5b046d90805eacd5eb6df669d2e4998cb149c Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Thu, 23 Sep 2021 16:59:03 +0800 Subject: BaseTools: Remove hard-coded strings for target and tools_def REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3653 The "target.txt" and "tools_def.txt" filenames are hard-coded at some places when global definitions are available at: BaseTools/Source/Python/Common/TargetTxtClassObject.py: DefaultTargetTxtFile and BaseTools/Source/Python/Common/ToolDefClassObject.py: DefaultToolsDefFile Use these global definitions instead. Also remove the unused gBuildConfiguration and gToolsDefinition variables from build.py Signed-off-by: Pierre Gondois Reviewed-by: Chris Jones Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- BaseTools/Source/Python/TargetTool/TargetTool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'BaseTools/Source/Python/TargetTool/TargetTool.py') diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/Source/Python/TargetTool/TargetTool.py index 71222e3cc8..7f2479f0f0 100644 --- a/BaseTools/Source/Python/TargetTool/TargetTool.py +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py @@ -17,6 +17,7 @@ import Common.BuildToolError as BuildToolError from Common.DataType import * from Common.BuildVersion import gBUILD_VERSION from Common.LongFilePathSupport import OpenLongFilePath as open +from Common.TargetTxtClassObject import gDefaultTargetTxtFile # To Do 1.set clean, 2. add item, if the line is disabled. @@ -25,7 +26,7 @@ class TargetTool(): self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE')) self.Opt = opt self.Arg = args[0] - self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', 'target.txt')) + self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', gDefaultTargetTxtFile)) if os.path.isfile(self.FileName) == False: print("%s does not exist." % self.FileName) sys.exit(1) -- cgit v1.2.3