Improvement to artifact delivery method

A target can define a delivery directory instead of the default option
pull/9633/head
Oren Cohen 2019-02-06 15:26:59 +02:00
parent 1c483e87b0
commit 04a22a2e69
1 changed files with 8 additions and 2 deletions

View File

@ -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)