From 3267655004d3f43eb14e0ea6a177bb09aaf19e65 Mon Sep 17 00:00:00 2001 From: Pavel Salomatov Date: Wed, 6 Mar 2019 20:00:45 +0300 Subject: [PATCH] releasetools: Add compatibility for custom out directory. sign_target_files_apks script looks for the signapk.jar inside the out dir. If the our dir is set to a different directory via OUT_DIR_COMMON_BASE the script does not work properly. From now script checks if the OUT_DIR_COMMON_BASE is set, then searches the jar in the proper path. If OUT_DIR_COMMON_BASE is unset, searches in "out" like it did before. Test: Build with OUT_DIR_COMMON_BASE set and unset and verify that sign_target_files_apks works in both cases Change-Id: I9218b98ff79526184f8353705640193405afac9e --- tools/releasetools/common.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index cfa81e1d1..9cda0bd2b 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -46,9 +46,15 @@ logger = logging.getLogger(__name__) class Options(object): def __init__(self): + base_out_path = os.getenv('OUT_DIR_COMMON_BASE') + if base_out_path is None: + base_search_path = "out" + else: + base_search_path = os.path.join(base_out_path, os.path.basename(os.getcwd())) + platform_search_path = { - "linux2": "out/host/linux-x86", - "darwin": "out/host/darwin-x86", + "linux2": os.path.join(base_search_path, "host/linux-x86"), + "darwin": os.path.join(base_search_path, "host/darwin-x86"), } self.search_path = platform_search_path.get(sys.platform)