From 04a22a2e693373190d38d8e9aeb067ba8d81afe5 Mon Sep 17 00:00:00 2001 From: Oren Cohen Date: Wed, 6 Feb 2019 15:26:59 +0200 Subject: [PATCH] Improvement to artifact delivery method A target can define a delivery directory instead of the default option --- tools/config/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/config/__init__.py b/tools/config/__init__.py index f8027c3529..e0e06801a6 100644 --- a/tools/config/__init__.py +++ b/tools/config/__init__.py @@ -49,6 +49,7 @@ PATH_OVERRIDES = set([ DELIVERY_OVERRIDES = set([ "target.deliver_to_target", "target.deliver_artifacts", + "target.delivery_dir" ]) ROM_OVERRIDES = set([ # managed BL @@ -600,8 +601,13 @@ class Config(object): def deliver_into(self): if self.target.deliver_to_target: - label_dir = "TARGET_{}".format(self.target.deliver_to_target) - target_delivery_dir = join(DELIVERY_DIR, label_dir) + delivery_target = Target.get_target(self.target.deliver_to_target) + if hasattr(delivery_target, "delivery_dir"): + target_delivery_dir = delivery_target.delivery_dir + else: + label_dir = "TARGET_{}".format(self.target.deliver_to_target) + target_delivery_dir = join(DELIVERY_DIR, label_dir) + if not exists(target_delivery_dir): os.makedirs(target_delivery_dir)