Not much time today, so not many updates.
Added command-line options for batch builds.
--hidden: do not show the C::B window.
--build: build the project/workspace.
--rebuild: clean and then build the project/workspace.
The project/workspace is specified last in the command-line.
This feature is best used with personalities. Because we just want to batch-build a project/workspace, we don't need to load other plugins than the compiler. What a perfect job for a new personality ;).
Small HOWTO:
Launch C::B using the command-line option --personality:
codeblocks.exe --personality="Build"
When C::B starts, it will start like it was just installed.
Uncheck the "Show tips at startup".
Go to "Plugins->Manage plugins" and uncheck all plugins except the compiler.
Close C::B.
A new configuration file named "Build.conf" will be saved in your config folder.
Now, if you want to batch-build a project/workspace, launch C::B with the following command-line:
codeblocks.exe --hidden --build c:\some\where\a\project.cbp
or
codeblocks.exe --hidden --rebuild c:\some\where\a\project.cbp
Now you can start those unattended nightly builds :)
(not quite; no build log is saved yet :P).
Added --target command-line option.
Example:
codeblocks.exe --personality=Build --hidden --rebuild --target="Release" ogre_sample.cbp > build.log
Also revamped the compiler plugin and it's now using a CommandQueue. This has simplified the plugin code a lot.
It seems that the last changes broke the linux-version of the compilergcc-plugin. While trying to compile the recent svn-version I got this error:
compilergcc.cpp: In member function `int CompilerGCC::DoRunQueue()':
compilergcc.cpp:767: error: ambiguous overload for 'operator+' in 'operator+(const wxString&, const wxChar*)(((const char*)" \'")) + cmd'
/usr/include/wx-2.6/wx/string.h:1466: note: candidates are: wxString operator+(const wxString&, const wxString&) <near match>
/usr/include/wx-2.6/wx/string.h:1467: note: wxString operator+(const wxString&, wxChar) <near match>
/usr/include/wx-2.6/wx/string.h:1468: note: wxString operator+(wxChar, const wxString&) <near match>
/usr/include/wx-2.6/wx/string.h:1470: note: wxString operator+(const wxChar*, const wxString&) <near match>
/usr/include/wx-2.6/wx/string.h:1479: note: wxString operator+(const wxString&, const wxCharBuffer&) <near match>
/usr/include/wx-2.6/wx/longlong.h:909: note: wxLongLong operator+(long int, const wxLongLong&) <near match>
/usr/include/wx-2.6/wx/longlong.h:922: note: wxULongLong operator+(long unsigned int, const wxULongLong&) <near match>
make[4]: *** [compilergcc.lo] Error 1
This is the problematic line:
cmd = GetConsoleShell() + _T(" '") + cmd + _T("'");
I assume that it should look like this:
cmd->command = GetConsoleShell() + _T(" '") + cmd->command + _T("'");
I don't know if it's correct and I could not test it yet but (at least in my opinion) it makes more sense than before and it compiles without any problems.
I just discovered another issue with that line. It encloses the command (that will be passed to the shell) with backticks ('). This makes sense but collides with the title for the shell which is also enclosed in backticks:
shell.Replace(_T("$TITLE"), _T("'") + m_Project->GetTitle() + _T("'"));
(This should be line 1134 in 'compilergcc.cpp'.)
Thus I think we should use double quotes (") to enclose the title instead of backticks. This seems to work (at least in my little test).
I just compiled and updated from revision 1425, and then performed the following command from my C::B dir:
output\codeblocks --personality=Build --hidden --build CodeBlocks-NewBuild.cbp | tee build.log
and the C::B window still showed itself, which I was assuming the --hidden parameter would prevent.
Did I misinterpret the intended meaning of this parameter?