User forums > Help

Pre-"workspace build" and post-"workspace build" scripts?

(1/2) > >>

filofel:
Hi,

I use  a workspace as a way to group several related projects.
And so far, I didn't find  a foolproof way to create a pre-build and/or a post-build workspace script that would execute when I do a "workspace build" or "workspace rebuild".
I could of course attach a pre-build script to the project that I assume will occur first, and a post-build script to the project that I assume would occur last, but this is unsafe, as a later modification in the projects dependencies could end up silently altering the order of the builds.

Is there a trick that I'm missing, or does something like that belong to the "Features request" section?

TIA,

Phil

thomas:
I don't think there is a way, nor that there will be one any time soon, since workspaces are not more than a collection of projects in Code::Blocks. There is no concept for something like a pre-build script, or compile options in them, no dialog where one could enter such a thing. So, implementing any such thing wouldn't be trivial.

filofel:
Thomas,

Bad news.
Workspaces are actually a little bit more than just "a collection of projects in Code::Blocks", since the build system offers to select "project dependencies" among the projects in a workspace, and apparently organizes the project builds inside the workspace in the right order: Having that, the execution position of the "pre-workspace-build" and "post-workspace-build" scripts become obvious.

The problem of workspace build (or compile) parameters is certainly more complex, but adding user-defined workspace-level variables could possibly provide an acceptable work around.

For any project that implies several distinct and/or intermediate targets, that could be really useful.

thomas:
I'm not saying it isn't useful, it is very useful. But I don't think it will be trivial to implement.

MortenMacFly:
Don't forget that you can control a whole build process from the command line. Thus if you need pre- post-build steps for a workspace, just write a script (batch) file with an automised build process. This can include any pre- or post-build steps for a workspace step you like. I for myself use this before building the C::B workspace. I do a source code sync before and file movement afterwards (if the build succeeded).

Navigation

[0] Message Index

[#] Next page

Go to full version