From 928fb44a0aa22da7c20a0170c045d64016e3474e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 16 Dec 2021 16:22:18 -0500 Subject: [PATCH] Fix flashbundle logic --- scripts/build/builders/esp32.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index d4ce65ded5dca3..e99ab8e291b1b7 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -66,12 +66,15 @@ def AppNamePrefix(self): elif self == Esp32App.TEMPERATURE_MEASUREMENT: return 'chip-temperature-measurement-app' elif self == Esp32App.TESTS: - return 'FIXME_FIXME_FIXME' + return None else: raise Exception('Unknown app type: %r' % self) @property def FlashBundleName(self): + if not self.AppNamePrefix: + return None + return self.AppNamePrefix + '.flashbundle.txt' def IsCompatible(self, board: Esp32Board): @@ -185,6 +188,16 @@ def _build(self): self._IdfEnvExecute(cmd, title='Building ' + self.identifier) def build_outputs(self): + if self.app == Esp32App.TESTS: + # Include the runnable image names as artifacts + result = dict() + with open(os.path.join(self.output_dir, 'test_images.txt'), 'rt') as f: + for name in f.readlines(): + name = name.strip() + result[name] = os.path.join(self.output_dir, name) + + return result + return { self.app.AppNamePrefix + '.elf': os.path.join(self.output_dir, self.app.AppNamePrefix + '.elf'), @@ -193,6 +206,9 @@ def build_outputs(self): } def flashbundle(self): + if not self.app.FlashBundleName: + return {} + with open(os.path.join(self.output_dir, self.app.FlashBundleName), 'r') as fp: return { l.strip(): os.path.join(self.output_dir, l.strip()) for l in fp.readlines() if l.strip()