News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

html build log file

Started by tiwag, October 24, 2006, 10:20:18 AM

Previous topic - Next topic

tiwag


1. the buildlog file doesn't prepend the project's name when building with batchbuild

2. would it be possible to change the buildlog so that it always contain the full commandline in the log,
   even when the IDE buildlog is set to any other format ?

thanks & brgds

killerbot

Quote from: tiwag on October 24, 2006, 10:20:18 AM

1. the buildlog file doesn't prepend the project's name when building with batchbuild

2. would it be possible to change the buildlog so that it always contain the full commandline in the log,
   even when the IDE buildlog is set to any other format ?

thanks & brgds

I can confirm issue 1, The Don is aware of it.
Hehe, patiently waiting ;-)

tiwag

#2
i used the following patch for testing the behaviour of 2.

Index: trunk/src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- trunk/src/plugins/compilergcc/compilergcc.cpp (revision 3133)
+++ trunk/src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -1030,6 +1030,10 @@
//        msgMan->Log(m_PageIndex, _T("[%u] %s"), procIndex, cmd->message.c_str());
         LogMessage(cmd->message);
     }
+    if (!cmd->command.IsEmpty())
+    {
+        LogMessage(_T(">>>") + cmd->command,false,false,false,true);
+    }

     if (cmd->command.IsEmpty())
     {


which results in pretty nice logs:

IDE build log:
-------------- Build: default in datetime ---------------
Compiling: dt.rc
Compiling: main.cpp
Compiling: controls.cpp
Linking executable: dt.exe
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings
Build log saved as: D:\Devel\_projects\datetime\datetime_build_log.html



build_log.html file
Build started on: 24-10-2006 at 12:02.19
Build ended on: 24-10-2006 at 12:02.21
-------------- Build: default in datetime ---------------
Compiling: dt.rc
>>>windres.exe -i dt.rc -J rc -o .objs\dt.res -O coff -ID:\MinGW\include
Compiling: main.cpp
>>>mingw32-g++.exe -Os -Wall -g -ID:\MinGW\include -c main.cpp -o .objs\main.o
Compiling: controls.cpp
>>>mingw32-g++.exe -Os -Wall -g -ID:\MinGW\include -c controls.cpp -o .objs\controls.o
Linking executable: dt.exe
>>>mingw32-g++.exe -LD:\MinGW\lib -o dt.exe .objs\main.o .objs\controls.o .objs\dt.res -mwindows
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings



but this solution works only when compiler logging is set to "Task description"

@mandrav
what do you think about changing the compiler logging output format in general,
so that full compiler logging always shows the messages from the Task description and the commandline,
as shown in the above example for the buildlog.html file ?

brgds

mandrav

Be patient!
This bug will be fixed soon...

tiwag

Quote from: mandrav on October 24, 2006, 01:04:41 PM
Both issues are fixed.

why do i get a "unnamed_build_log.html" file when i batch-build a project ??
the project's name should be known i guess  :P

mandrav

Quote from: tiwag on October 27, 2006, 08:26:39 AM
Quote from: mandrav on October 24, 2006, 01:04:41 PM
Both issues are fixed.

why do i get a "unnamed_build_log.html" file when i batch-build a project ??
the project's name should be known i guess  :P

When building a project, the log has the name of the project.
When building a workspace, the log has the name of the workspace. If the workspace is unnamed (e.g. "Workspace" shows in C::B), then the log is "unnamed" :P.
Be patient!
This bug will be fixed soon...

tiwag

#6
Quote from: mandrav on October 27, 2006, 09:12:44 AM
Quote from: tiwag on October 27, 2006, 08:26:39 AM
why do i get a "unnamed_build_log.html" file when i batch-build a project ??
the project's name should be known i guess  :P

When building a project, the log has the name of the project.
When building a workspace, the log has the name of the workspace. If the workspace is unnamed (e.g. "Workspace" shows in C::B), then the log is "unnamed" :P.

this is what i would expect,
my project has definitely a name, but i still get an unnamed_build_log.html file,when i do a batch-build from the right-click explorer menu  :?
when i build the same project from the ide, the name of the logfile is correctly set to projectname_build_log.html

edit:
please note, i'm using a project file (*.cbp) and NOT a workspace file

other test:
batch-building of the workspace DOES produce a workspacename_build_log.html file

conclusion:
only when batch-building a project file i get the unnamed_build_log.html file

brgds

tiwag


killerbot

coincidence, I was just testing this, yes sir : building a cbp from the explorer == > "unnamed_build_log.html"  :-(

killerbot

#9
look at this code :
void CompilerGCC::InitBuildLog(bool workspaceBuild)
{
    wxString title;
    wxString basepath;
    wxString basename;
    if (!workspaceBuild && m_Project)
    {
        title = m_Project->GetTitle();
        basepath = m_Project->GetBasePath();
        basename = wxFileName(m_Project->GetFilename()).GetName();
        basename = _T("baa");
    }
    else if (workspaceBuild)
    {
        cbWorkspace* wksp = Manager::Get()->GetProjectManager()->GetWorkspace();
        title = wksp->GetTitle();
        basepath = wxFileName(wksp->GetFilename()).GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
        basename = wxFileName(wksp->GetFilename()).GetName();
        basename = _T("boo");
    }

    if (basename.IsEmpty())
        basename = _T("unnamed");

    // init HTML build log
    m_BuildStartTime = wxDateTime::Now();
    m_BuildLogTitle = title + _(" build log");
    m_BuildLogFilename = basepath;
    m_BuildLogFilename << basename << _T("_build_log.html");
    m_BuildLogContents.Clear();
}


I added that "baa" and "boo", and we end up at the  "boo", meaning that the bool that enters is on true and says it's a workspace build, which it was not.

This can only happen when called from :
int CompilerGCC::BuildWorkspace(const wxString& target)

because of :
int CodeBlocksApp::BatchJob()
{
    ...
    if (m_ReBuild)
        compiler->RebuildWorkspace(m_BatchTarget);
    else if (m_Build)
        compiler->BuildWorkspace(m_BatchTarget);

killerbot