Skip to content

Commit

Permalink
Fix flashbundle logic
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Dec 16, 2021
1 parent 557a55a commit 928fb44
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/build/builders/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'),
Expand All @@ -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()
Expand Down

0 comments on commit 928fb44

Please sign in to comment.