Merge "Remove OPTIONS.host_tools" into main am: 092719a471

Original change: https://android-review.googlesource.com/c/platform/build/+/2688229

Change-Id: I0b32673a99a1104480e38168119e1a641c476fe0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-08-02 02:49:42 +00:00
committed by Automerger Merge Worker

View File

@@ -96,7 +96,6 @@ class Options(object):
self.cache_size = None self.cache_size = None
self.stash_threshold = 0.8 self.stash_threshold = 0.8
self.logfile = None self.logfile = None
self.host_tools = {}
self.sepolicy_name = 'sepolicy.apex' self.sepolicy_name = 'sepolicy.apex'
@@ -225,23 +224,15 @@ def InitLogging():
logging.config.dictConfig(config) logging.config.dictConfig(config)
def SetHostToolLocation(tool_name, location):
OPTIONS.host_tools[tool_name] = location
def FindHostToolPath(tool_name): def FindHostToolPath(tool_name):
"""Finds the path to the host tool. """Finds the path to the host tool.
Args: Args:
tool_name: name of the tool to find tool_name: name of the tool to find
Returns: Returns:
path to the tool if found under either one of the host_tools map or under path to the tool if found under the same directory as this binary is located at. If not found,
the same directory as this binary is located at. If not found, tool_name tool_name is returned.
is returned.
""" """
if tool_name in OPTIONS.host_tools:
return OPTIONS.host_tools[tool_name]
my_dir = os.path.dirname(os.path.realpath(sys.argv[0])) my_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
tool_path = os.path.join(my_dir, tool_name) tool_path = os.path.join(my_dir, tool_name)
if os.path.exists(tool_path): if os.path.exists(tool_path):