Code::Blocks
July 29, 2010, 05:56:16 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Code::Blocks Logo Elections closed! And the winner is... otaco!
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]
  Send this topic  |  Print  
Author Topic: post build step : launch plugin  (Read 878 times)
killerbot
Global Moderator
Lives here!
*****
Posts: 3883


« on: January 28, 2010, 08:24:38 pm »

Dear All,

What do you think about the following idea :

Quote
Would it be nice to be able to launch a plug-in as a post build step (or maybe pre build step) of a build of target/project.

A simple example. Suppose you want to have Cppcheck run on your project as a post build step.
Why : you want to ensure that stuff builds, and that CppCheck doesn't find any issues.

Another example :
When you have a unit test project, it might be very interesting to have it run at the end of it's build ($exe_output), but it might be evenly interesting to have it run by Valgrind.

How far away are we from achieving such behavior ?

Any further ideas ?
Logged
MortenMacFly
Administrator
Lives here!
*****
Posts: 4593



WWW
« Reply #1 on: January 29, 2010, 07:15:57 am »

Quote
Would it be nice to be able to launch a plug-in as a post build step (or maybe pre build step) of a build of target/project.
How far away are we from achieving such behavior ?
IMHO it's already (at least partially) possible and in fact I am doing this.

What's needed is a batch file (in my case) which you provide with the information required via macros.
This way you can run an external (stand-alone) application with all the information needed. this worked fine for me for things like documentation update (doxygen), reporting and logging.

For the plugins we probably would need to declare events like:
- build succeeded for target/project/workspace
- pre-pre-processor, post-pre-processor for targets
- pre-post-processor, post-post-processor for targets

I'm open for it if a plugin makes more sense because it needs to access a lot of information (e.g. from other targets, compiler options and so on...).
Logged

Logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
Compiling help
Debugging help
Portable C::B
mandrav
Project Leader
Administrator
Lives here!
*****
Posts: 4253



WWW
« Reply #2 on: January 29, 2010, 03:53:09 pm »

Correct me if I 'm wrong, but isn't it already possible to run script commands in pre/post build steps?
AFAIR, scripting exposes ToolPlugins' "Execute()" function already.
Logged

Be patient!
This bug will be fixed soon...
MortenMacFly
Administrator
Lives here!
*****
Posts: 4593



WWW
« Reply #3 on: January 29, 2010, 04:13:12 pm »

isn't it already possible to run script commands in pre/post build steps?
You tell - you did it. But yes: Scripting is surely possible. So that's another possibility. Smile
Logged

Logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
Compiling help
Debugging help
Portable C::B
killerbot
Global Moderator
Lives here!
*****
Posts: 3883


« Reply #4 on: January 29, 2010, 07:02:05 pm »

Hey Yiannis, good you give an example ?
Logged
mandrav
Project Leader
Administrator
Lives here!
*****
Posts: 4253



WWW
« Reply #5 on: January 29, 2010, 11:26:34 pm »

Hey Yiannis, good you give an example ?

In rev.6118, two new script commands were added: ExecuteToolPlugin() and ConfigureToolPlugin().
You can now put something like this in your post-build steps:

Code:
[[ ExecuteToolPlugin(_("CppCheck")) ]]

Enjoy Smile
Logged

Be patient!
This bug will be fixed soon...
killerbot
Global Moderator
Lives here!
*****
Posts: 3883


« Reply #6 on: January 30, 2010, 12:18:25 am »

gonna try them out tomorrow.
Hehe nice to have the boss back  Razz
Logged
oBFusCATed
Lives here!
****
Posts: 1081


« Reply #7 on: February 01, 2010, 10:15:35 am »

Another feature request for the "Post build step":

Is it possible to add option: "ReRun if Build/Post build failed last time"
This will be useful for unittest projects, where the resulting executable is run in the postbuild step.
At the moment I have to enable the option "Always run post build step", in order to get constant test failures

Example:
Code:
0. Load the project
1. Edit code/tests
2. Hit compile
3. The tests are run and fail
4. Hit compile again (no changes to code),
  Expected behavior: tests are run again and fail.
  If the "Always run post build step" is not enabled the build succeeds, which is wrong.

The current solution works, but is not optimal for large projects (many projects in a workspace, with lots of test projects),
because every time the user hits "Compile" all the test projects will be run, which costs time Sad
Logged
Pages: [1]
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!