How would I go about using the post-build commands? I have tried for a while and can't get anything at all to happen. The closest I can figure is that the compiler-independant option, console shell, is not configurable, and is stuck using a linux file (xterm). Could this be what the problem is?
Specifically, in the post-build commands box, I have:
start "C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:"C:\Documents and Settings\Eric Burnett\Desktop\fractalBrowser" /notempfile
start "C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:commit /path:"C:\Documents and Settings\Eric Burnett\Desktop\fractalBrowser" /notempfile
Ideally, I would have it commit my code to a repository on a successful build, but I am having trouble atm.
Thanks!
--Eric Burnett
QuoteThe closest I can figure is that the compiler-independant option, console shell, is not configurable, and is stuck using a linux file (xterm)
This is disabled because it only makes sense under linux. For windows the command shell is standard (cmd.exe or command.exe). In linux there are too many shells and terminals to choose from ;)
Note that the commands you can use
must be existing executables. This means you can use
cp.exe, but you can't use
copy because
copy is an internal shell command (search for
copy.exe - you 'll find nil).
I 'm not sure, but I think
start is also an internal command.
To overcome this limitation, you can enter your commands in a batch file and use this in the commands box.
QuoteIdeally, I would have it commit my code to a repository on a successful build, but I am having trouble atm.
Keep in mind that if this action asks you for a password, you will not see it because codeblocks doesn't run the commands in an interactive shell...
In this case, a solution would be (I haven't tried it!):
Suppose you have your commands in a batch file named
commit_after_build.bat.
You would normally use as a post-build command in codeblocks:
commit_after_build.batTo run this in an interactive shell, use this:
cmd /k commit_after_build.bat.
This will run your commands in an interactive shell ("dos" box) and keep it open until the commands finish executing.
HTH,
Yiannis.
Ok, I see what I was doing wrong. But I still can't get it to do anything at all...when I type anything (including 'cmd /k commit_after_build.bat', which now refers to a batch file in the root directory of my project), nothing happens. And also, nothing is logged on any of the bottom tabs like I would have expected, which leads me to believe that this is actually disabled/broken at the time being. I would have expected 'cmd /k' to at least bring up a commnd prompt.
The post-build step is ran just after linking. If you 're trying it on an already linked project, the post-build step won't run...
To test it, delete the executable to force it to be re-linked.
Yiannis.
I just noticed there is a bug with the pre-build and post-build commands, when using GNU "make" to build :oops:
Either wait for next release (any day now), or use compiler in direct-mode...
Yiannis.
Haha alright. I will wait until after that comes out before I try to fix this any more. For now I have setup two tools to do it instead, so its not critical.
Keep up the good work!
This has been puzzling me with its lack of...well...anything, so I thought I would take a look at how it works for myself. I grabbed and compiled a copy of Codeblocks from the cvs, then started digging into it. But I am stuck on one thing...DirectCommands::GetPreBuildCommands takes a ProjectBuildTarget as its parameter, then calls target->GetCommandsBeforeBuild() on it. But when looking at the definition of ProjectBuildTarget, I can't find the GetCommandsBeforeBuild() function definition, and I can't see where a child class is being constructed that defines it :oops:. Care to point me in the right direction?
Thanks.
QuoteCare to point me in the right direction?
Sure thing:
ProjectBuildTarget is-a CompileTargetBase (compiletargetbase.h) which is-a CompileOptionsBase (compileoptionsbase.h).
Yiannis.
Thanks. For the moment I've been sidetracked into hunting bugs in the debugger, but when it is working to my satisfaction I will work on this again 8)