Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: threeS on September 29, 2014, 03:32:27 am

Title: Retrieve all build messages
Post by: threeS on September 29, 2014, 03:32:27 am
Good day to all!

I am now doing a plugin that connects to the database every time the codeblocks compiles(thanks to you all for the previous questions). Using the code below:

Manager::Get()->RegisterEventSink(cbEVT_COMPILER_STARTED, new cbEventFunctor<PluginName,CodeBlocksEvent>(this,&PluginName::OnCompileStart));
Manager::Get()->RegisterEventSink(cbEVT_COMPILER_STARTED, new cbEventFunctor<PluginName,CodeBlocksEvent>(this,&PluginName::OnCompileEnd));

Now I want to get all the messages generated in the "Build messages" tab can you help me in this problem guys?

CodeBlocks Build Number: 9851
OS: Ubuntu 14.04 64 bit

Thanks in advance!  ;D
Title: Re: Retrieve all build messages
Post by: Alpha on September 29, 2014, 06:11:14 am
I recommend digging around in C::B for the relevant API calls.  The following files should be a good starting place:
include/logmanager.h
include/logger.h
include/loggers.h
plugins/compilergcc/compilermessages.h
Title: Re: Retrieve all build messages
Post by: threeS on September 30, 2014, 03:46:39 am
I've been digging the codes that you suggested but I realized that it becomes a little bit tricky I guess when it comes to how will I get the instance of the Logger/Loggers/CompilerMessages classes that the compiler class uses when compiling, because if I will create a new instance then it is useless I guess.

 ??? ::)
Title: Re: Retrieve all build messages
Post by: stahta01 on September 30, 2014, 04:17:00 am
No idea; but, maybe looking at the code the saves the Build log as HTML would be an option.

Tim S.
Title: Re: Retrieve all build messages
Post by: Alpha on September 30, 2014, 05:46:38 am
Hmm, yes, API does not look too friendly for this.  You could try LogManager->Slot(int i)->[title: check name; GetLogger()]->typecastAndHope.
Title: Re: Retrieve all build messages
Post by: MortenMacFly on September 30, 2014, 07:47:22 am
Hmm, yes, API does not look too friendly for this.  You could try LogManager->Slot(int i)->[title: check name; GetLogger()]->typecastAndHope.
You (threeS) could introduce a new API and provide us with a patch...
Title: Re: Retrieve all build messages
Post by: threeS on September 30, 2014, 01:27:12 pm
Yes we will be happy if we could help the codeblocks community by this. Me and my friend(forum name, kugtong33) will be glad to help but we use git and we found in the wiki on how to contribute using git but is it ok with you guys if we setup a mirrored repository in github? And one more thing, since this is a homework as i stated I might first figure out how to get those build messages. :D

Thanks for the replies.
Title: Re: Retrieve all build messages
Post by: ollydbg on September 30, 2014, 03:31:58 pm
Yes we will be happy if we could help the codeblocks community by this. Me and my friend(forum name, kugtong33) will be glad to help but we use git and we found in the wiki on how to contribute using git but is it ok with you guys if we setup a mirrored repository in github?
It's OK to mirror the repo in github, why not?  :)
I also use git and git-svn.
Title: Re: Retrieve all build messages
Post by: Jenna on September 30, 2014, 03:46:35 pm
There are already several codeblocks mirrors on github.
One is mine in https://github.com/jenslody, but that is not always uptodate, because I need to manual push it from my own server.
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.
Title: Re: Retrieve all build messages
Post by: ollydbg on September 30, 2014, 03:51:30 pm
...
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.
Hi, jens, does the above address allow user to clone it? (I have tried, but failed)
Or it is a web interface? Thanks.
Title: Re: Retrieve all build messages
Post by: stahta01 on September 30, 2014, 03:57:05 pm
I found the Mirror by biplab to be the easiest to clone and work with; but, that might just be the fact I tried it last. (I am hoping that I am getting better with Git with time.)

    Git URL: git://cb.biplab.in/codeblocks.git

Tim S.
Title: Re: Retrieve all build messages
Post by: Jenna on September 30, 2014, 08:40:49 pm
...
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.
Hi, jens, does the above address allow user to clone it? (I have tried, but failed)
Or it is a web interface? Thanks.
Sorry, yes it's the webinterface.
You should be able to clone the repos with :
Quote
git clone git://jenslody.de/git/codeblocks
Quote
git clone git://jenslody.de/git/wxWidgets
Quote
git clone git://jenslody.de/git/gnome-shell-extension-openweather
Quote
git clone git://jenslody.de/git/gnome-shell-extension-panel-osd

I also corrected the clone-url shown by cgit.
Title: Re: Retrieve all build messages
Post by: kugtong33 on September 30, 2014, 10:36:09 pm
Creating an organization(like codeblocks, codeblocks.sourceforge, etc.) in the github and put all the repositories in one place(in the organization) might be a better idea and this makes it a lot easier for others to find it.

 ;D
Title: Re: Retrieve all build messages
Post by: stahta01 on September 30, 2014, 11:29:17 pm
Creating an organization(like codeblocks, codeblocks.sourceforge, etc.) in the github and put all the repositories in one place(in the organization) might be a better idea and this makes it a lot easier for others to find it.

 ;D

I take it you are NOT a Git user, correct?

Tim S.
Title: Re: Retrieve all build messages
Post by: threeS on September 30, 2014, 11:59:04 pm
If the community don't want it that way, well there is no problem.
Title: Re: Retrieve all build messages
Post by: kugtong33 on October 01, 2014, 12:03:58 am
Average user I think  ???

Well I am just starting to know how the open source community works
 ;D
Title: Re: Retrieve all build messages
Post by: Jenna on October 01, 2014, 12:11:56 am
The official Code::Blocks repo is a subversion repo and is hosted at sourceforge: http://sourceforge.net/projects/codeblocks/ .
Title: Re: Retrieve all build messages
Post by: ollydbg on October 01, 2014, 05:11:43 pm
...
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.
Hi, jens, does the above address allow user to clone it? (I have tried, but failed)
Or it is a web interface? Thanks.
Sorry, yes it's the webinterface.
You should be able to clone the repos with :
Quote
git clone git://jenslody.de/git/codeblocks
Quote
git clone git://jenslody.de/git/wxWidgets
Quote
git clone git://jenslody.de/git/gnome-shell-extension-openweather
Quote
git clone git://jenslody.de/git/gnome-shell-extension-panel-osd

I also corrected the clone-url shown by cgit.
Thanks, this works fine. I also update our wiki Developer documentation - CodeBlocks (http://wiki.codeblocks.org/index.php?title=Developer_documentation)