Author Topic: batchbuild  (Read 6784 times)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
batchbuild
« on: April 05, 2006, 11:06:00 am »
could we please have an option, which closes the batchbuild-log-window automatically, if no errors occured during building ?

this would be nice when calling codeblocks for batchbuilding from batchfiles,
so that the remaining batchfile commands can be processes without user-interaction when CB is done with batchbuilding.

also some errorlevel settings would be nice to have in order to control the batchfile execution if something went wrong during batchbuilding.

would someone (beside me) want and use such things too ?
i would be interested in your comments, in order to decide if work on such things would be of interest .

thanks
« Last Edit: April 05, 2006, 11:08:19 am by tiwag »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: batchbuild
« Reply #1 on: April 05, 2006, 11:57:40 am »
By default the window closes now. If you want it to stay open, use --no-batch-window-close.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuild
« Reply #2 on: April 05, 2006, 12:06:31 pm »
thanks for the fast update !

but may i propose to close it only if no build error occured ?

something like:

Code
    if (m_BatchNotify)
    {
        wxString msg;
        if (m_BatchExitCode == 0)
            msg << _("Batch build ended.\n");
        else
            msg << _("Batch build stopped with errors.\n");
        msg << wxString::Format(_("Process exited with status code %d."), m_BatchExitCode);
        cbMessageBox(msg, g_AppName, m_BatchExitCode == 0 ? wxICON_INFORMATION : wxICON_WARNING);
    }
    else
        wxBell();

    if (m_pBatchBuildDialog && m_BatchWindowAutoClose && (m_BatchExitCode == 0))    // <------ change is HERE
        m_pBatchBuildDialog->EndModal(wxID_OK);
}


btw. would it somehow be possible to pass the m_BatchExitCode value back to the caller envinronment ?
« Last Edit: April 05, 2006, 12:08:06 pm by tiwag »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: batchbuild
« Reply #3 on: April 05, 2006, 12:12:51 pm »
Quote
but may i propose to close it only if no build error occured ?

something like:

Sure, go ahead and update it.

Quote
btw. would it somehow be possible to pass the m_BatchExitCode value back to the caller envinronment ?

But it does... in CodeBlocksApp::OnExit() the return value is m_BatchExitCode for batch builds...
Is it not called?
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: batchbuild
« Reply #4 on: April 05, 2006, 12:33:56 pm »
Quote
btw. would it somehow be possible to pass the m_BatchExitCode value back to the caller envinronment ?

On closer inspection, you 're right.

Quote from: wxWidgets docs wxApp::OnExit()
The return value of this function is currently ignored, return the same value as returned by the base class method if you override it.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuild
« Reply #5 on: April 05, 2006, 01:46:36 pm »
Quote from: tiwag
but may i propose to close it only if no build error occured ?

Sure, go ahead and update it.

ok, done.
thanks again, works fine now with scripts ...  :D

regarding the returnvalue issue ... i'll look if there is any solution possible

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: batchbuild
« Reply #6 on: August 29, 2006, 10:26:30 pm »
I'm also trying to use codeblock batch capability in scripting (using msbuild). However if there was a compile error the BatchBuildDialog doesn't close. This stops the msbuild script. Is it possible to go on with the msbuild script, closing the BatchBuildDialog (returning error code)?

I think it must be possible to instuct the batch building process to always exit (close windows)  giving proper exit code.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuild
« Reply #7 on: August 31, 2006, 06:35:03 pm »
... if there was a compile error the BatchBuildDialog doesn't close. This stops the msbuild script.
Is it possible to go on with the msbuild script, closing the BatchBuildDialog (returning error code)?

implemented in svn rev 2936

* batchbuild log window auto-closes even when an error occurred during the build,
  if the option --no-batch-window-close was not given.
- Info: a non-zero build-error-code is returned as exit-code when batchbuilding and
  can be handled by the calling batch-script

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: batchbuild
« Reply #8 on: August 31, 2006, 07:10:30 pm »
attached is a sample project which shows the batch-build script and exit-code examination (build.cmd)

(edit the wx_console.cpp to look how it works with errors)

you need to edit the path to your CodeBlocks.exe
note: i use a special personality "batchbld" for batchbuilds, with deactivated plugins
if you want his too, start CB before with the option -p=batchbld and
set all settings (compiler directories, plugin deactivation, etc. ... )

[attachment deleted by admin]
« Last Edit: August 31, 2006, 07:29:26 pm by tiwag »

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: batchbuild
« Reply #9 on: August 31, 2006, 09:16:45 pm »
Thankx
I will test it asap.
regards
Jan

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: batchbuild
« Reply #10 on: August 31, 2006, 09:43:59 pm »
Perfect!!!
It works as you described!!!