Author Topic: Doxygen plugin  (Read 285570 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Doxygen plugin
« Reply #30 on: March 05, 2010, 09:55:38 pm »
-Added: Inserted comments blocks are now indented to match the code that they're commenting.
Can't wait testing... :-)

Looks REALLY good so far... Good work! :P
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline codeur

  • Multiple posting newcomer
  • *
  • Posts: 113
    • Code::Blocks EDU-Portable
Re: Doxygen plugin
« Reply #31 on: March 05, 2010, 11:56:24 pm »
DoxyBlocks builds in the trunk development environment, except that it attempts to link with -lwx_mswu-2.8.dll which is not in my system. I have to link with -lwxmsw28u (wxmsw28u.dll which I have) instead. Once I link it this way, it runs OK in the trunk version of CB (still cannot get it to load in our svn 6113 production system unfortunately, but I am getting closer).

I am totally unfamiliar with CB development so I have this newbie question for you Gary: is "libwx_mswu-2.8.dll.a" or "wx_mswu-2.8.dll" a file we are supposed to obtain from building the wxwidgets or during their installation?

BTW: I am impressed by the amount of work you have produced for this doxygen plugin in this short time... and you are a perfectionist, fixing details before they are mentioned to you. I am feeling quite awed really, thanks.

Offline private_joker

  • Single posting newcomer
  • *
  • Posts: 7
Re: Doxygen plugin
« Reply #32 on: March 06, 2010, 02:56:43 am »
Bug: if tabs w. sourcecode isn't open and you trying push "Extract documentation..." button, CB will crash.

Bug: ExtractDocs.cpp:551

Code
ret = wxExecute (cmd + wxT(" ") + fnDoxyfile.GetFullPath(), sOutput, sErrors);
if(ret == 0)
 {}

Quote
Execution of 'C:\Program Files\doxygen\bin\doxygen.exe' failed.

It seems like "if(ret == 0)" isn't fully correct. Maybe better use "if(ret != -1)"

Probably Bug: doxywizard isn't run.

Quote
Running doxywizard...
Process 3308 (C:\Program Files\doxygen\bin\doxywizard.exe C:\Program Files\CodeBlocks\workspace\Codeblocks-Nightly\src\plugins\contrib\doxyblocks\doxygen\doxyfile) launched.

I'm using self builded CB and self builded Doxyblocks. Both from SVN trunk.

Thank you & keep working on it.



Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #33 on: March 06, 2010, 08:31:13 pm »

  Hey Codeur,

DoxyBlocks builds in the trunk development environment, except that it attempts to link with -lwx_mswu-2.8.dll which is not in my system. I have to link with -lwxmsw28u (wxmsw28u.dll which I have) instead. Once I link it this way, it runs OK in the trunk version of CB (still cannot get it to load in our svn 6113 production system unfortunately, but I am getting closer).

That sounds fine. There are still some subtleties of building in C::B that I haven't yet mastered. I tried removing ".dll" from my build settings and it builds just fine. I can see from the output that it links to the same file. C::B does have a system that adds prefixes and suffices to library names. The ".dll" is obviously unnecessary. Much of what I have set up is garnered from other plug-ins. Looking at the latest SVN, I see that plug-ins are set up with the lib described like this : "wxmsw28$(WX_SUFFIX)" where WX_SUFFIX = "u". I am gradually homing in on the correct settings to match the default set in the C::B code but I still have the problem that I have been unable to find any way to build wx with the "gcc_dll" style path. Until I can get that set up I won't be able to match C::B exactly, however I think that this is mostly obscured by the $(WX) variable. I will look at improving my library naming scheme as per the contrib plug-ins.

I haven't tried anything below 6130 and I'm now using 6182.  :)

I am totally unfamiliar with CB development so I have this newbie question for you Gary: is "libwx_mswu-2.8.dll.a" or "wx_mswu-2.8.dll" a file we are supposed to obtain from building the wxwidgets or during their installation?

When you build the plug-in, it links with your build of wx, i.e. you need to either build it yourself or download some pre-compiled libs. See http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.2_to_develop_Code::Blocks_%28MSW%29. It's a bit out of date re: wx but still useful. I heartily recommend building it as it gives you much more control. C::B will prefix "libwx_" and postfix ".a" (and apparently ".dll") to the name in build settings so you should only need to enter "wx_mswu-2.8". The one thing I'm not certain of yet is whether "wxmsw28$(WX_SUFFIX)" expands to "mswu-2.8" or "msw-2.8u". I will find out shortly.  :wink:

BTW: I am impressed by the amount of work you have produced for this doxygen plugin in this short time... and you are a perfectionist, fixing details before they are mentioned to you. I am feeling quite awed really, thanks.

Thanks.  8)
Coding is "what I do" so I like it and this is my pet project at the moment. And yes, I'm a perfectionist.
I'm using it every day, as well, so it gets a good workout.

Cheers.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #34 on: March 06, 2010, 09:12:43 pm »
-Added: Inserted comments blocks are now indented to match the code that they're commenting.
Can't wait testing... :-)

Looks REALLY good so far... Good work! :P

Thanks Morten. I'm hoping to get it into the contrib collection so please let me know if there is anything I need to do before that can happen e.g. setup, standards, build settings, etc.

I still have a couple of things in mind. I have realised that the current configuration scheme won't work well across projects. All settings are global at the moment which means that settings such as project version, comment style, doxyfile defaults, etc., which should be per-project settings, will carry over to subsequent projects. I am going to change that today so that those items are stored per-project in the .cbp. Settings such as paths to executable files can and should remain global.
I would also like to look at automating comment insertion across whole files and, if that's practical, perhaps across whole projects. That does raise some issues, though, such as how to differentiate between a function definition in a .cpp and the prototype in a .h and avoid commenting them both. My current thinking is that commenting a whole file is probably as far as I should go.
I also want to improve the regexes. I have detection of multiple return vals working in the regex testbed but it fails in the code. I don't understand that as the testbed is built with the same wx and therefore uses the same function calls. Any ideas?

Cheers,

  Gary.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #35 on: March 06, 2010, 09:17:36 pm »

 Hi Guys,

I have been tinkering with some of the other plug-ins in my travels around C::B, as well. Of note is that I have added a new comment type to the ToDo plug-in to allow it to insert "\todo" lines directly into C-style doxygen blocks. The existing C++-type doxygen-style comment already does this well for C++-styled comments but none worked for C-styled blocks. The details are here:
http://forums.codeblocks.org/index.php/topic,12130.0.html

Cheers.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #36 on: March 06, 2010, 10:32:00 pm »

  Hey Joker,

Thanks for taking the time to report your findings, I really appreciate it.

Bug: if tabs w. sourcecode isn't open and you trying push "Extract documentation..." button, CB will crash.

Whoa doctor! That's not good. I've looked into this. In fact, the only button that does not crash C::B when there are no tabs open is the config. dialogue button. My code is never executed i.e. C::B crashes before it gets to my code. I can't trap it. I think that the config button may work because it uses a default plug-in function. Execution doesn't reach the first line of the function called by connect() to respond to the event. Morten, can you shed any light on this?

In the meantime the workaround is to ensure that you have at least one editor window open when running DoxyBlocks functions.

Bug: ExtractDocs.cpp:551

Code
ret = wxExecute (cmd + wxT(" ") + fnDoxyfile.GetFullPath(), sOutput, sErrors);
if(ret == 0)
 {}

Quote
Execution of 'C:\Program Files\doxygen\bin\doxygen.exe' failed.

It seems like "if(ret == 0)" isn't fully correct. Maybe better use "if(ret != -1)"

From the docs: "In the case of synchronous execution, the return value is the exit code of the process (which terminates by the moment the function returns) and will be -1 if the process couldn't be started and typically 0 if the process terminated successfully."
I take your point. != -1 does seem to be more correct.  I've changed it, thanks. Are you seeing a problem? You don't say.

Probably Bug: doxywizard isn't run.

Quote
Running doxywizard...
Process 3308 (C:\Program Files\doxygen\bin\doxywizard.exe C:\Program Files\CodeBlocks\workspace\Codeblocks-Nightly\src\plugins\contrib\doxyblocks\doxygen\doxyfile) launched.

So you're seeing this message and then doxywizard doesn't appear? I'd say if a process number is returned then it ran. What happens after the process is spawned is not C::B's doing. I see, however, that you are using the notorious "Program Files" directory and I would guess that the space in the path is choking doxywizard. I would recommend never using Program Files for anything of your own and leaving it for Windows' use. Since doxygen is originally a Unix application I would think that it doesn't like spaces.

[Update:] I ran a check and, sure enough, doxywizard fails if I use a path to a doxyfile that contains spaces. DoxyBlocks should quote the path to avoid the problem. I'll fix that and upload it to SVN later today. Thanks.

I'd appreciate an update once you've tried it to let me know whether that fixes it for you.

I'm using self builded CB and self builded Doxyblocks. Both from SVN trunk.

Thank you & keep working on it.

Thanks. You can count on it.   :P

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #37 on: March 06, 2010, 10:58:46 pm »

Uploaded 0.7.670. SVN revision 12.

Change log:
-Added: The block comment sample now updates to reflect the selection when "Use @ In Tags" selection is changed.
-Cleaned: Improved some text generation to simplify localisation strings.
-Added: Some missing documentation.
-Updated: Improved return value checking when running doxygen. Thanks to private_joker.
-Updated: Quoted the doxyfile path when running doxywizard to avoid doxywizard crash if the path contain spaces. Thanks to private_joker.

Cheers.

Offline private_joker

  • Single posting newcomer
  • *
  • Posts: 7
Re: Doxygen plugin
« Reply #38 on: March 07, 2010, 12:32:48 am »

  Hey Joker,

Thanks for taking the time to report your findings, I really appreciate it.

No problem, I'd want too to comment my code, normally is look like:

// don't know how, but it works, thank you God. Amen.
 :P

From the docs: "In the case of synchronous execution, the return value is the exit code of the process (which terminates by the moment the function returns) and will be -1 if the process couldn't be started and typically 0 if the process terminated successfully."
I take your point. != -1 does seem to be more correct.  I've changed it, thanks. Are you seeing a problem? You don't say.

Now is working.

So you're seeing this message and then doxywizard doesn't appear? I'd say if a process number is returned then it ran. What happens after the process is spawned is not C::B's doing. I see, however, that you are using the notorious "Program Files" directory and I would guess that the space in the path is choking doxywizard. I would recommend never using Program Files for anything of your own and leaving it for Windows' use. Since doxygen is originally a Unix application I would think that it doesn't like spaces.

[Update:] I ran a check and, sure enough, doxywizard fails if I use a path to a doxyfile that contains spaces. DoxyBlocks should quote the path to avoid the problem. I'll fix that and upload it to SVN later today. Thanks.

Yep. Now is working too.


I know it sounds a bit pedantic but:

ExtractDocs.cpp:565

Code
if(sText.Length() > 0)

I think
Code
if(!sText.IsEmpty())
is better  :)



Offline PizzaNapoli

  • Single posting newcomer
  • *
  • Posts: 6
Re: Doxygen plugin
« Reply #39 on: March 07, 2010, 01:17:59 pm »
Hi, everybody

I have the same problem as "codeur" in "Reply #12".

Unfortunately I can't install that plugin.

I use this CB version: Release 8.02 (2008-02-27 19:55:16) gcc 4.2.1 Windows/unicode on a Windows XP SP2

Now I'm not sure if this problem was solved, and if yes how ?

« Last Edit: March 07, 2010, 01:28:22 pm by PizzaNapoli »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Doxygen plugin
« Reply #40 on: March 07, 2010, 05:23:47 pm »
I'm hoping to get it into the contrib collection so please let me know if there is anything I need to do before that can happen e.g. setup, standards, build settings, etc.
There is:
- The project files need some clean-up (I did this already and can provide you with a patch).
- The update files need some cleanup (do not create a "*.cbplugin" file as contrib plugin)
- It needs to be compilable under Linux using automake, so the "makefile.am's" are missing
- Do not include sdk_precomp.h directly, this is only correct for the core of C::B. Instead, include sdk.h
- I didn't verify the include statements of the plugin so far and whether they are correct in terms of PCH. However, here are the rules that need to apply:
http://wiki.codeblocks.org/index.php?title=Precompiled_headers

However, these are only minor things. Basically the lacking automake is currently the major show-stopper.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Doxygen plugin
« Reply #41 on: March 07, 2010, 05:38:03 pm »
However, these are only minor things. Basically the lacking automake is currently the major show-stopper.

I hope I find the time to create it this evening and post the patch here (Just for the automake, nothing else, due to lack of time).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Doxygen plugin
« Reply #42 on: March 08, 2010, 05:18:09 am »
However, these are only minor things. Basically the lacking automake is currently the major show-stopper.

I hope I find the time to create it this evening and post the patch here (Just for the automake, nothing else, due to lack of time).

I attached a patch containing the needed stuff for automake and debian (not for rpm-based distros).
The DoxyBlocks sources have to be in "src/plugins/contrib/DoxyBlocks" (the CamelCase is important, otherwise the files have to be fixed accordingly).

[attachment deleted by admin]

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #43 on: March 10, 2010, 06:19:34 am »
...
Now is working.
...
Yep. Now is working too.

Excellent, thanks.

I know it sounds a bit pedantic but:

ExtractDocs.cpp:565

Code
if(sText.Length() > 0)

I think
Code
if(!sText.IsEmpty())
is better  :)

Roger, thanks.

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: Doxygen plugin
« Reply #44 on: March 10, 2010, 06:22:38 am »
 
  Hey there,

I have the same problem as "codeur" in "Reply #12".

Unfortunately I can't install that plugin.

I use this CB version: Release 8.02 (2008-02-27 19:55:16) gcc 4.2.1 Windows/unicode on a Windows XP SP2

Now I'm not sure if this problem was solved, and if yes how ?

As noted in another post, I think there is little chance of it working in vanilla 8.02. You will probably need to build C::B yourself to get it working, at this stage. There's plenty of help here in the forum and on the wiki to get you going.

Cheers,

  Gary.