Author Topic: rebuiding entire workspace from the command line  (Read 10176 times)

gilado

  • Guest
rebuiding entire workspace from the command line
« on: November 24, 2005, 08:08:31 am »
Using Microsoft Visual Studio you can rebuild all projects in a workspace by typing at the command line
msdev myworkspace.dsw /MAKE ALL

is there a similar feature in codeblocks?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: rebuiding entire workspace from the command line
« Reply #1 on: November 24, 2005, 08:50:53 am »
would be interesting feature, for automatic (nightly builds).

With MS VC 2005, it even improved, it is a special build exe, so no gui which is been hidden.

Lieven

Offline etko

  • Multiple posting newcomer
  • *
  • Posts: 10
    • Homepage
Re: rebuiding entire workspace from the command line
« Reply #2 on: December 05, 2005, 09:47:03 am »
Yes something command like make but understanding C::B project files would be cool.

takeshimiya

  • Guest
Re: rebuiding entire workspace from the command line
« Reply #3 on: December 05, 2005, 10:21:39 am »
It's already there in SVN HEAD. :D

Examples of use:
Code
codeblocks.exe --build --target="Release" c:\some\where\a\project.cbp
Builds the target release of the specified project.

Code
codeblocks.exe --personality=MyBuild --rebuild c:\some\where\a\project.cbp > build.log
Rebuilds all the targets of the specified project, using the specified personality, and redirecting the build log to a file.

As for having a special build exe so no GUI is hidden, as it's not an easy task, I guess it will be available in Code::Blocks Studio 2007 or so :P

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: rebuiding entire workspace from the command line
« Reply #4 on: December 05, 2005, 10:44:46 am »
Just want to add that it works with workspaces the same way. And if you give a --target argument for a workspace, only this target is built for all projects in the workspace.
Be patient!
This bug will be fixed soon...

Offline VincentB

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: rebuiding entire workspace from the command line
« Reply #5 on: March 12, 2007, 05:10:32 pm »
Just to say that this does not seem to work any longer with SVN 3677. There seems to be a regression.

Also CB crashes when the worspace name is incorrect. Finally the help site still does not indicate how to set the workspace/project name in the command line, I will edit it with the Wiki based on your message, assuming that this is the expected behaviour.

Please see the message that I have replied to Mr Tobiaslohe on another topic.

Hello,

I am a newcomer to CodeBlocks, and I have a similar problem as Mr tobiaslohe. I would like to set the workspace in the command line when launching codeblocks in order to compile my workspace from an MS DOS batch, or from a Visual Basic Script, or from any kind of shell script.

I could not find the relevant information either in the help site http://wiki.codeblocks.org/index.php?title=Command_line_arguments

My nightly build is svn 3677 (March 8th 2007, 23:18:02 -wx2.6.3).
I am using Windows XP, and MinGW on top of MSYS.

Could anyone tell me if this is supported (If not I can report a bug on the Berlios site)

My command line is :

codeblocks --no-splash-screen --target="Release" --personality="Lite" --rebuild myworkspace.cbp > compile.log

The content of compile log is after this line execution :

Nothing to be done.

Nothing to be done.

Nothing to be done.


Also, I noticed that when the filename/filepath & name myworkspace.cbp is incorrect, I get a notification "The project does not exists" twice, and then codeblocks crashes.

By the way it would be nice if the the indication of codeblock build was possible to cut and paste from the Menu help->about, that would be easier than copying it to this message by hand for lasy ones like me  8)

Very best regards,
                Vincent.






Offline VincentB

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: rebuiding entire workspace from the command line
« Reply #6 on: March 12, 2007, 05:34:27 pm »
Just to say that I have updated http://wiki.codeblocks.org/index.php?title=Command_line_arguments  based on the information from Mr Mandrav's post 3603 December 05, 2005, 09:44:46 AM.

I hope that my message is not going to be overlooked as this discussion happened more than one year ago.

Best regards,
               Vincent.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: rebuiding entire workspace from the command line
« Reply #7 on: March 12, 2007, 06:41:39 pm »
My command line is :
codeblocks --no-splash-screen --target="Release" --personality="Lite" --rebuild myworkspace.cbp > compile.log

Also, I noticed that when the filename/filepath & name myworkspace.cbp is incorrect, I get a notification "The project does not exists" twice, and then codeblocks crashes.
That is truly a bug. The reason is that in compilergcc.cpp in int CompilerGCC::Clean(const wxString& target) the line:
Code
clean = dc.GetCleanSingleFileCommand(Manager::Get()->GetEditorManager()->GetActiveEditor()->GetFilename());
crashes because Manager::Get()->GetEditorManager()->GetActiveEditor() returns NULL. Will fix that in a minute... Thanks for spotting this.
With regards, Morten.

Edit: Fixed in SVN.
« Last Edit: March 12, 2007, 07:47:12 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline VincentB

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: rebuiding entire workspace from the command line
« Reply #8 on: March 13, 2007, 08:49:13 am »
Dear Mr MortenMacFly,

Thank you for your quick and kind answer. May I ask some additional questions :

1) Is your correction only for preventing CB from crashing when the project/workspace filename is incorrect, or is it also going to solve this that I get no rebuild from command line even with a correct filename ?

2) Have you checked that my update on http://wiki.codeblocks.org/index.php?title=Command_line_arguments  is correct, I would really hate to have produced incorrect information on this page.

3) Are you to anounce on this forum when the fix is done, so that I can download the nightly build at this moment only.

Very best regards,
                           Vincent.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: rebuiding entire workspace from the command line
« Reply #9 on: March 14, 2007, 08:09:15 am »
1) Is your correction only for preventing CB from crashing when the project/workspace filename is incorrect, [...]
Only for that part.

2) Have you checked that my update on http://wiki.codeblocks.org/index.php?title=Command_line_arguments
Yes, this seems to be correct.

3) Are you to anounce on this forum when the fix is done, [...]
Did that already for the part above.

Anyway - The command line e.g. D:\Devel\CodeBlocks_Devel\codeblocks.exe --no-splash-screen --target="Release" --rebuild MyCon.cbp >_ works very well for me - it is indeed a re-build that gets triggered. However, there is a message popping up "Project already exists in workspace" which is another bug (and prevents *any* batch-build from being issued until the message is acknowledged, which is *bad*). BTW: This also happens for DDE (click on a .cbp file in the explorer). Will have a look into that...

With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: rebuiding entire workspace from the command line
« Reply #10 on: March 14, 2007, 09:34:52 am »
Well... all this should be fixed now in SVN. Any nightly after and including r3694 should work properly again.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ