Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on October 24, 2006, 10:20:18 am

Title: html build log file
Post by: 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
Title: Re: html build log file
Post by: killerbot on October 24, 2006, 12:01:24 pm

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 ;-)
Title: Re: html build log file
Post by: tiwag on October 24, 2006, 12:12:23 pm
i used the following patch for testing the behaviour of 2.

Code
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:
Code
-------------- 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
Code
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
Title: Re: html build log file
Post by: mandrav on October 24, 2006, 01:04:41 pm
Both issues are fixed.
Title: Re: html build log file
Post by: tiwag on October 27, 2006, 08:26:39 am
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
Title: Re: html build log file
Post by: mandrav on October 27, 2006, 09:12:44 am
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.
Title: Re: html build log file
Post by: tiwag on October 27, 2006, 09:25:50 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
Title: Re: html build log file
Post by: tiwag on October 31, 2006, 10:10:37 am
bump
Title: Re: html build log file
Post by: killerbot on October 31, 2006, 10:15:05 am
coincidence, I was just testing this, yes sir : building a cbp from the explorer == > "unnamed_build_log.html"  :-(
Title: Re: html build log file
Post by: killerbot on October 31, 2006, 10:46:39 am
look at this code :
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 :
Code
int CompilerGCC::BuildWorkspace(const wxString& target)

because of :
Code
int CodeBlocksApp::BatchJob()
{
    ...
    if (m_ReBuild)
        compiler->RebuildWorkspace(m_BatchTarget);
    else if (m_Build)
        compiler->BuildWorkspace(m_BatchTarget);
Title: Re: html build log file
Post by: killerbot on October 31, 2006, 11:27:39 am
FIXED : rev 3163   :P