doc: fix zephyr-app-commands for west
Always show how to build. We can't do anything without a build directory. Fixes: #18760 Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
91c7d0c13a
commit
cfd1f4950f
1 changed files with 21 additions and 10 deletions
|
@ -251,27 +251,38 @@ class ZephyrAppCommandsDirective(Directive):
|
||||||
if cd_into and app:
|
if cd_into and app:
|
||||||
content.append('cd {}'.format(app))
|
content.append('cd {}'.format(app))
|
||||||
|
|
||||||
if 'build' in goals:
|
# We always have to run west build.
|
||||||
build_args = ' -b {}{}{}{}'.format(board, dst, src, cmake_args)
|
#
|
||||||
content.append('west build{}'.format(build_args))
|
# FIXME: doing this unconditionally essentially ignores the
|
||||||
|
# maybe-skip-config option if set.
|
||||||
|
#
|
||||||
|
# This whole script and its users from within the
|
||||||
|
# documentation needs to be overhauled now that we're
|
||||||
|
# defaulting to west.
|
||||||
|
#
|
||||||
|
# For now, this keeps the resulting commands working.
|
||||||
|
content.append('west build -b {}{}{}{}'.
|
||||||
|
format(board, dst, src, cmake_args))
|
||||||
|
|
||||||
goal_args = '{}'.format(dst)
|
# If we're signing, we want to do that next, so that flashing
|
||||||
|
# etc. commands can use the signed file which must be created
|
||||||
|
# in this step.
|
||||||
if 'sign' in goals:
|
if 'sign' in goals:
|
||||||
content.append('west sign{}'.format(goal_args))
|
content.append('west sign{}'.format(dst))
|
||||||
|
|
||||||
for goal in goals:
|
for goal in goals:
|
||||||
if goal == 'build' or goal == 'sign':
|
if goal == 'build' or goal == 'sign':
|
||||||
continue
|
continue
|
||||||
elif goal == 'flash':
|
elif goal == 'flash':
|
||||||
content.append('west flash{}'.format(goal_args))
|
content.append('west flash{}'.format(dst))
|
||||||
elif goal == 'debug':
|
elif goal == 'debug':
|
||||||
content.append('west debug{}'.format(goal_args))
|
content.append('west debug{}'.format(dst))
|
||||||
elif goal == 'debugserver':
|
elif goal == 'debugserver':
|
||||||
content.append('west debugserver{}'.format(goal_args))
|
content.append('west debugserver{}'.format(dst))
|
||||||
elif goal == 'attach':
|
elif goal == 'attach':
|
||||||
content.append('west attach{}'.format(goal_args))
|
content.append('west attach{}'.format(dst))
|
||||||
else:
|
else:
|
||||||
content.append('west build -t {}{}'.format(goal, goal_args))
|
content.append('west build -t {}{}'.format(goal, dst))
|
||||||
|
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue