Executing Multiple Commands as Post-Build Steps in Eclipse
Join the DZone community and get the full member experience.
Join For Freethe gnu arm eclipse plugins from liviu already offer several built-in actions which can be performed at the end of a build: creating flash image , create listing file and printing the code and data size:
but what if i need different things, or even more things?
post-build steps
for this there is the ‘post-build steps’ settings i can use: that command is executed at the end of the build:
:!: the post build step is only executed if sources files have been compiled and linked. if you want to enforce that there is always a ‘true’ post build, then you need to delete some files in the pre-build step to enforce a compilation and a link phase.
multiple post-build steps
but what i need more than one action in the post-build step? i could call a batch or script file, but this is probably an overkill in too many cases, and adds a dependency to that script file. a better approach is to directly execute multiple commands as post-build step.
unfortunately, the documentation found about the post-build step with a web-search is misleading (e.g. in the eclipse luna documentation ):
“command: specifies one or more commands to execute immediately after the execution of the build. use semicolons to separate multiple commands.”
unfortunately, semicolons is plain wrong (at least did not work for me) :-(. the solution is to use ‘ & ‘ (ampersand) to separate multiple commands on windows :
:idea: on linux, use the ‘;’ to separate commands as noted in the documentation/help, and use ‘&’ on windows. unfortunately, this makes project not cross-platform.
and this works for me, at least under windows 7 :-).
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments