@@ -251,27 +251,38 @@ def _generate_west(self, **kwargs):
251251 if cd_into and app :
252252 content .append ('cd {}' .format (app ))
253253
254- if 'build' in goals :
255- build_args = ' -b {}{}{}{}' .format (board , dst , src , cmake_args )
256- content .append ('west build{}' .format (build_args ))
257-
258- goal_args = '{}' .format (dst )
254+ # We always have to run west build.
255+ #
256+ # FIXME: doing this unconditionally essentially ignores the
257+ # maybe-skip-config option if set.
258+ #
259+ # This whole script and its users from within the
260+ # documentation needs to be overhauled now that we're
261+ # defaulting to west.
262+ #
263+ # For now, this keeps the resulting commands working.
264+ content .append ('west build -b {}{}{}{}' .
265+ format (board , dst , src , cmake_args ))
266+
267+ # If we're signing, we want to do that next, so that flashing
268+ # etc. commands can use the signed file which must be created
269+ # in this step.
259270 if 'sign' in goals :
260- content .append ('west sign{}' .format (goal_args ))
271+ content .append ('west sign{}' .format (dst ))
261272
262273 for goal in goals :
263274 if goal == 'build' or goal == 'sign' :
264275 continue
265276 elif goal == 'flash' :
266- content .append ('west flash{}' .format (goal_args ))
277+ content .append ('west flash{}' .format (dst ))
267278 elif goal == 'debug' :
268- content .append ('west debug{}' .format (goal_args ))
279+ content .append ('west debug{}' .format (dst ))
269280 elif goal == 'debugserver' :
270- content .append ('west debugserver{}' .format (goal_args ))
281+ content .append ('west debugserver{}' .format (dst ))
271282 elif goal == 'attach' :
272- content .append ('west attach{}' .format (goal_args ))
283+ content .append ('west attach{}' .format (dst ))
273284 else :
274- content .append ('west build -t {}{}' .format (goal , goal_args ))
285+ content .append ('west build -t {}{}' .format (goal , dst ))
275286
276287 return content
277288
0 commit comments